Rational Developer for System z
Enterprise PL/I for z/OS, Version 3.8, Language Reference Manual

KEY option

The KEY option specifies a character, graphic or widechar key that identifies a record. It can be used in a READ statement for an INPUT or UPDATE file, or in a REWRITE statement for a DIRECT UPDATE file.

The KEY option applies only to KEYED files. The KEY option is required if the file has the DIRECT attribute and optional if the file has the SEQUENTIAL and KEYED attributes.

The expression in the KEY option is evaluated and, if not character, graphic or widechar, is converted to a character value that represents a key. It is this character, graphic or widechar value that determines which record is read.

The following example specifies that the record identified by the character value of the variable Stkey is read into the variable Item:

  read file (Stpck) into (Item) key (Stkey);

Terms of use | Feedback

This information center is powered by Eclipse technology. (http://www.eclipse.org)