Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

Programming the KDCS error handling routines

The kcrccc return code in the return area of the communication area is returned as a threecharacter field in the C/C++ KDCS interface. If the C/C++ macros are not used, then the values must be compared using the strncmp function.

The request for the return code is simpler when the macro interface is used:
The kcmac.h header file defines a return code in the static variable long KCRCC that contains the integer value of the kcrccc field after each macro call. Determining if an error occurred during the call is then limited to checking KCRCC.

For comparison, here are two examples of determining if an error has occurred after a KDCS call:

  • for a direct call:

    if(strncmp(kb->rti.kcrccc,"000",3) != 0) ...

  • when using a macro:

    if (KCRCC != 0) ...

To ensure a better diagnosis of a problem, all unused parameters are automatically set to binary zero before a KDCS call when the macros are used.
In this manner, the entire parameter area contains a precisely defined set of data. If an error occurs, the parameter area can be specifically checked and any deviation from the expected contents can be detected.