Your Browser is not longer supported

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

{{viewport.spaceProperty.prod}}

Statement return code mechanism

&pagelevel(5)&pagelevel

LMS supports statement return codes analogous to the command return codes (see [4 (Related publications)]). The statement return code allows the user to react as necessary to specific conditions after each LMS statement.

Structure of the statement return codes

The statement return code has three parts:

Maincode:   Message code; the meaning can be retrieved with /HELP-MSG-INFORMATION.

Subcode1:   Error class (decimal); indicates the gravity of the error.

Subcode2:  Supplementary information (decimal); e.g. subcode2 = 2 in conjunction with

subcode1 = 0 indicates a warning.

Controlling the output of statement return codes

The output of statement return codes is activated with the command:

/BEGIN-BLOCK PROGRAM-INPUT=*MIXED-WITH-CMD( -

/ PROPAGATE-STMT-RC=*TO-CMD-RC )

The statement return codes can then be evaluated in S procedures with SDF-P means (see the SDF-P manual "Programming in the Command Language" [12 (Related publications)]). The SDF-P built-in functions MAINCODE() or MC(), SUBCODE1() or SC1() and SUBCODE2() or SC2() can be used for evaluation.

Error handling at the command level is triggered when statement return codes are output, i.e. a jump to the next /IF-CMD-ERROR, /IF-BLOCK-ERROR or /STEP command.

The error handling is triggered if subcode1 of the statement return code is not equal to 0. This is the case with all error messages. The setting of MAX-ERROR-WEIGHT has no effect.

The statement return code can be saved with the /SAVE-RETURNCODE command. /IF-CMD-ERROR implicitly executes the /SAVE-RETURNCODE command.

Note

With maincodes LMS1002, LMS1003 and LMS1004, the true error must be taken from the LMS protocol, if this is present. Maincode LMS1003 after a statement with a wildcard entry may mean that several errors have occurred.

The following possible statement return codes are defined for LMS.

(SC2)

SC1

Maincode

Meaning


1
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
2
32
64
64
64
64
64
64
64
64
64
64
64
64
64
64
64
64
64
64
64
64
64
64
130
130
130
130
130

CMD0001
LMS0036
LMS0053
LMS0064
LMS0071
LMS0084
LMS0095
LMS0102
LMS0129
LMS0151
LMS0163
LMS0199
LMS0201
LMS0274
LMS0286
LMS0712
LMS0714
LMS0721
CMD0230
LMS0238
LMS1002
LMS0020
LMS0035
LMS0093
LMS0211
LMS0213
LMS0214
LMS0301
LMS0302
LMS0303
LMS0304
LMS0509
LMS0510
LMS1003
LMS1004
PLA0223
PLA0224
PLA0229
PLA0233
PLA0475
PLA0476
PLA0478
LMS0041
LMS0081
LMS0411
LMS0412
LMS0413

No error
Library not assigned
Member and file attributes different
GCCSN macro error; no CCS name specified
XHCS not loaded
VTSUCB macro error
Input records missing
Incomplete module in EAM file
Statement aborted by user
Input or output medium set to standard
At least one record truncated
Record length invalid with fixed record format
Only the comparison area is logged
Block control value changed
File attributes not modified
Touch not possible
Touch not possible on empty file
The specified target is already current
Syntax error
Error while loading LMS
Internal error
Target member or target file does not exist
Member protection not transferrable to file
Protocol member already exists
Library already exists
Name exists as delta member
Name exists as full member
File not found
Member not found
Member not in the range of the reference condition
Type not found
Target member or target file already exists
Base not found
Error during batch (wildcard) processing with at least one member or file
Other error
Only the leaves of a delta tree can be overwritten
Storage form not allowed
No access right for the member
Borrowing status prevents member access
Function violates the version automation
Version does not comply with the valid convention
Increase causes version overflow
System address space exhausted
No further storage space for SYSLST file
Library locked
Member locked
Type locked

(SC2) : Subcode2 = 0 is represented by blanks

The possible return codes are shown again in the descriptions of the separate LMS statements.

Example

Search for member A in LIB1 or LIB2 :

/BEGIN-BLOCK PROGRAM-INPUT=*MIXED-WITH-CMD( -
/            PROPAGATE-STMT-RC=*TO-CMD-RC )
/START-LMS
//SHOW-ELEM-ATTR  *LIB(LIB = LIB1, ELEM = A, TYP = S),TEXT-OUT=*NONE
/IF-CMD-ERROR
//  SHOW-ELEM-ATTR  *LIB(LIB = LIB2, ELEM = A, TYP = S),TEXT-OUT=*NONE
/   IF-CMD-ERROR
/      SET-VAR LIB = 'none'
/   ELSE
/      SET-VAR LIB = 'LIB2'
/   END-IF
/ELSE
/   SET-VAR LIB = 'LIB1'
/END-IF
/WR-TEXT 'Member A is in the &LIB library'
//END
/END-BLOCK