All DMS macros use the standard header for BS2000 macros in their 31-bit interface. This standard header is an 8-byte field at the beginning of the operand list which contains the standardized designation of the interface and provides space for return codes. It is generated by each macro and should – wherever possible – be initialized with the list form of the MF operand.
Structure of the standard header
Field | Byte position | Meaning |
UNIT | 0-1 | Specifies the function unit in which the desired function is implemented |
FUNCTION | 2 | Specifies the function (within the function unit) |
VERSION | 3 | Specifies the version number of the function |
SUBCODE2 | 4 | Contains subsidiary return code 2 |
SUBCODE1 | 5 | Contains subsidiary return code 1 |
MAINCODE | 6-7 | Contains the main return code |
The fields SUBCODE2, SUBCODE1, MAINCODE contain the return code. The main return code indicates whether or not the operation was executed successfully. In the case of an error, the subsidiary return codes can be used to diagnose the reason for the error.
The following values for the return codes are conventions:
SUB- | SUB- | MAIN- | Meaning |
X'00' | X'00' | X'0000' | The function was executed successfully; there is no further information for this MAINCODE. |
X'01' | X'00' | X'0000' | The function was executed successfully; no further action is necessary. |
X'00' | X'01' | X'FFFF' | The requested function is not supported (invalid (entry for UNIT or FUNCTION in the standard header); unrecoverable error. |
X'00' | X'02' | X'FFFF' | The specified function is not available; unrecoverable error. |
X'00' | X'03' | X'FFFF' | The specified version of the interface is not supported (invalid version entry in the standard header); unrecoverable error. |
X'00' | X'04' | X'FFFF' | The parameter list is not aligned on a word boundary. |
X'00' | X'41' | X'FFFF' | The subsystem does not exist; it must be generated explicitly. |
X'00' | X'42' | X'FFFF' | The calling process is not connected to this interface; it must be connected explicitly. |
X'00' | X'81' | X'FFFF' | The subsystem is currently not available. |
X'00' | X'82' | X'FFFF' | The subsystem is in the DELETE or HOLD state. |
MAINCODE shows the result of execution of the function. SUBCODE1 qualifies the main code. SUBCODE2 subdivides the errors into error classes.
The return code should be passed only in the standard header (except for DMS macros; see "DMS error codes"). However, for a transitional period the return code can also be passed in register R15 or in both the standard header and register R15. In order to check whether a return code has been passed in the standard header, the return code field should be filled with X'FFFFFFFF'. The result of checking the standard header is also always returned in register R15:
X'00000000': | standard header correctly initialized; error-free execution. |
X'0001FFFF' | invalid entry for UNIT or FUNCTION. |
X'0003FFFF': | invalid entry for VERSION. |