Command return codes consist of three parts:
the maincode, a message code that can be specified with the HELP-MSG-INFORMATION command in order to obtain detailed information.
subcode 1, which assigns the error situation to an error class that indicates how serious an error is. Subcode 1 has a decimal value. The following five error classes are defined in BS2000:
Class A: no error
The value is zero. Processing can proceed normally.
Class B: syntax error
The value is a number between 1 and 31. The command was entered with incorrect syntax. The command can be entered again after the syntax error has been corrected.
Class C: internal error (system error)
The value is 32. Input can be repeated if the internal error has been recovered.
Class D: errors that cannot be assigned to any other error class.
The value is a number between 64 and 127. Evaluate the maincode to determine how to proceed.
Class E: the command cannot be executed at the moment.
The value is a number between 128 and 130. Command input can be repeated without modification. The wait time may be short, long or indefinite. 128 indicates a short wait time, considered practical in interactive mode. 129 indicates a long wait time, considered practical in batch mode.
130 indicates an indefinite wait time and uncertainty as to whether the error will be recovered at all.
subcode 2, which can contain additional information (value is not zero). Subcode 2 has a decimal value. In the event of an error (subcode 1 is not zero), there are no rules regarding the use of subcode 2. The value of subcode 2 may be zero, 1 or 2 if no error has occurred.
Subcode 2 with the value 1 indicates that the requested function was already available before the command was issued. Subcode 2 with the value 2 indicates an exception situation and should be classified as a warning.
Command return codes can only be evaluated with SDF-P resources in S procedures and dialog blocks (see the “SDF-P” manual [34]). For information on evaluation see also the descriptions of the IF-BLOCK-ERROR command and of the builtin functions MAINCODE, SUBCODE1 and SUBCODE2 in the section "Builtin functions".
Representation of command return codes
Command return codes are represented in tabular form in the order: subcode 2, subcode 1, maincode, meaning. A subcode 2 with the value zero (i.e. no additional information present) is not listed in the table. If messages are guaranteed in a table for a specific command return code, the heading “Meaning” is supplemented by “/Guaranteed messages”, and the message codes of the guaranteed messages are given after the meaning. The user can output the meanings of these message codes with the HELP-MSG command.
Example
(SC2) | SC1 | Maincode | Meaning/Guaranteed messages |
---|---|---|---|
0 | CMD0001 | Command terminated without errors | |
1 | 32 | CMD0500 | Incorrect syntax description in current syntax file |
64 | CMD0554 | Command execution not successful. |