Your Browser is not longer supported

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

{{viewport.spaceProperty.prod}}

SUBCODE1( ) Request subcode1

&pagelevel(3)&pagelevel

Domain: Command return code

The SUBCODE1( ) function supplies the error class 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 the /SAVE-RETURNCODE command.

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 dialog blocks.

Format

SUBCODE1( )

SC1( )


Result type

INTEGER (<integer 0..255>)

Input parameters

None

Result

Designation of the error class in the form of an integer <integer 0..255>

0
No errors have yet occurred in the current procedure or the command whose return code was saved with /SAVE-RETURNCODE was executed without an error.

Error messages

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

Example

Error handling with SUBCODE1( )

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