KEYCHECK control statement

The KEYCHECK optional control statement activates the key sequence check option to ensure that the segment key fields are in ascending sequence.

0........1.........2.........3.........4.........5.........6.........7.........8
12345678901234567890123456789012345678901234567890123456789012345678901234567890

KEYCHECK ABEND
         GX
         GG
Position
Description
1
Code the KEYCHECK keyword to activate the option that checks the key sequence. It must be used with one of the following three code options. (Separate the words with a space.)
10
Code one of the following optional keywords:
ABEND
Performs key checking and ends abnormally if a sequence error is detected.
GX
Performs key checking and returns a warning GX status code if a sequence error is detected. The segment with the incorrect key is returned normally to the calling application program or utility.

For the EXEC DLI command, the status GX is not returned to the application program. Instead, message DFS1041 is issued in the EXEC DLI interface module (DFSEIPB0). It ends with a code of U1041.

GG
Performs a key check and returns a GG status code if a sequence error is detected. No segment will be returned to the calling application program or utility.

This option requires PROCOPT=GON, GOT, or an active SKERROR; if none of these conditions is specified, HSSR Engine abends instead of returning a GG status code. If the SKERROR control statement is active, HSSR Engine does not retrieve the incorrect segment or other related segments during the processing of the next GN call. If the SKERROR control statement is inactive, HSSR Engine resets the current position to the beginning of the database.

Restrictions:
  • If APISET 3 is specified, this statement cannot be specified.
  • If one or more partitions of PHDAM or PHIDAM are in the HALDB OLR cursor-active status, KEYCHECK=ABEND/GX/GG is ignored.