Example of NULL-KEY-MAP IS Phrase
In this example, the following values represent the key in a file,
which contains 3 fields of 2 bytes each. The key is defined by the
following code in the File Section:
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT FILE-1 ASSIGN to DATABASE-FILE1-ALWNULL
ACCESS is DYNAMIC RECORD KEY IS FULL-PRODUCT-CODE IN FILE-1
ORGANIZATION IS INDEXED.
FD FILE-1.
01 FULL-PRODUCT-CODE.
05 TYPE-CODE PIC X(2).
05 COLOR-CODE PIC X(2).
05 LOCATION-CODE PIC X(2).
WORKING-STORAGE SECTION.
01 FILE1-N.
05 FULL-PRODUCT-CODE-NKM.
06 FILLER PIC X VALUE ZERO.
06 COLOR-CODE-NF PIC 1 VALUE B"0".
06 LOCATION-CODE-NF PIC 1 VALUE B"0".
Fields 2
and 3 are null-capable, where '-' indicates null, and xx indicates
any value. The following are representations of the records in the
file: NN----
NN--xx
NNxx--
Consider the following START statement: START FILE-1
NULL-KEY-MAP IS FULL-PRODUCT-CODE-NKM
INVALID KEY DISPLAY "No data in system for product code " TYPE-CODE
GO TO ERROR-ROUTINE
END-START.
If the null-key-map in the START statement
has a value of 010, the pointer is set to point
to the record with the key NN--xx. If the null-key-map
in the START statement has a value of 011, the pointer
is set to point to the record with the key NN----.For more information about using null-capable fields, refer to the IBM® Rational® Development Studio for i: ILE COBOL Programmer's Guide.