Your Browser is not longer supported

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

{{viewport.spaceProperty.prod}}

SUBCODE2( ) Request subcode2

&pagelevel(3)&pagelevel

Domain: Command return code

The SUBCODE2() function supplies the severity of the current command return code, i.e. the return code of the last command which resulted in an error or which was followed by /SAVE-RETURNCODE.

Command return codes consist of three components: Subcode1 and Subcode2, which indicate the error class and error severity, and the maincode, which contains the sevencharacter error code. The functions SUBCODE1(), SUBCODE2() and MAINCODE() are used to evaluate these components. The MSG( ) function can be used to output the message corresponding to the error code of MAINCODE().

SUBCODE2() is not available outside procedures and blocks.

Format

SUBCODE2( )

SC2( )


Result type

INTEGER (<integer 0..255>)

Input parameters

None

Result

Value of subcode2 in the form of an integer (<integer 0..255>)

Error messages

SDP0428     COMMAND RETURN CODE NOT AVAILABLE IN DIALOG
SDP0435     DESIRED INFORMATION NOT AVAILABLE

Example

Error handling with SUBCODE2( )

/DECLARE-VARIABLE MYVAR
/...
/DECLARE-VARIABLE MYVAR   “already declared”
/SAVE-RETURNCODE
/IF ((SUBCODE1=0) AND (SUBCODE2=1))
/   WRITE-TEXT 'variable already declared'
/END-IF