The ON clause tests for a specific path status returned to indicate the result of the statement. If LRF returns the specified path status, the imperative statement included in the ON clause is executed; if the specified path status is not returned, the imperative statement included in the ON clause is ignored and IDMS_STATUS is performed.
The ON clause tests for a standard or DBA-defined path status, which is in the form of a 1- to 16-character unquoted string. Path statuses are issued during execution of the path selected to service the request.
Standard Path Statuses
Standard path statuses are as follows:
Note: A successful STORE can return LR_NOT_FOUND if its WHERE clause references a logical-record field and the STORE path performs no OBTAINs.
Note: For more information about error-status codes, see Communications Blocks and Error Detection.
►►─── ON LR_STATUS (path-status) imperative-statement;───────────────────────►◄
Names the path status that will be tested. Path-status must be a 1- to 16-character alphanumeric value.
Specifies the program action to be taken if the indicated path status results from the logical-record request.
The following statements use the path status LR_NOT_FOUND in two different ways. If LR_NOT_FOUND occurs following the initial statement, an LR_MISSING message is output; if LR_NOT_FOUND occurs in subsequent statements, an END_OF_LR message is output.
OBTAIN FIRST RECORD (EMP_JOB_LR) WHERE (OFFICE_CODE_0450 EQ OFFICE_CODE_IN); ON LR_STATUS (LR_NOT_FOUND) CALL LR_MISSING; . . . OBTAIN NEXT RECORD (EMP_JOB_LR) WHERE (OFFICE_CODE_0450 EQ OFFICE_CODE_IN); ON LR_STATUS (LR_NOT_FOUND) CALL END_OF_LR; . . . CALL OBTAIN_REST_LR;
The following codes are returned to the ERROR_STATUS field in the IDMS DB or IDMS DC communications block when an LR_ERROR path status is returned to the LR_STATUS field in the LRC block:
The requested logical record was not found in the subschema. (The path DML statement, EVALUATE, returns 0000 if true, and 2001 if false.)
The named record is not in the subschema, or the specified request is not permitted for the named record.
The subschema prohibits access to logical records.
A path command has attempted to access a database record that has not been bound.
The WHERE clause in an OBTAIN NEXT command directed LRF to a different processing path than did the WHERE clause in the preceding OBTAIN command for the same logical record.
The request's WHERE clause cannot be matched to a path in the subschema.
The logical-record path for the request specifies return of the LR_ERROR status.
Bad or inconsistent data was encountered in the logical-record buffer during evaluation of the request's WHERE clause.
The request's WHERE clause does not include data required by the logical-record path.
A subscript value in a WHERE clause is either less than zero or greater than its maximum allowed value.
A program check has revealed an arithmetic exception (for Example, overflow, underflow, significance, divide) during evaluation of a WHERE clause.
The request's WHERE clause contains a keyword that exceeds the 16-character maximum.
The path command has attempted to access a CALC data item that has not been defined properly in the subschema.
The request's WHERE clause is too long to be evaluated in the available work area.
|
Copyright © 2014 CA.
All rights reserved.
|
|