KEYED{(*CHAR : key-length)}

The KEYED keyword is used in a free-form file definition to specify that the file is to be opened in keyed sequence, and that keyed file operations are allowed for the file.

For an externally-described file, the KEYED keyword has no parameter.

  DCL-F file1 DISK(*EXT) KEYED;
For a program-described file, only alphanumeric keys are supported. The KEYED keyword must have two parameters, *CHAR and the length of the key.

  DCL-F file2 DISK(100) KEYED(*CHAR : 10);

If you want to define a program-described file with a different type of key, you can specify KEYED(*CHAR:key_length) to define the key as alphanumeric, and use a data structure as the search argument in keyed operations where the data structure has a subfield of the required data type.