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

KEYTO option

The KEYTO option specifies the character, graphic or widechar variable to which the key of a record is assigned. The KEYTO option can specify any string pseudovariable other than STRING. It cannot specify a variable declared with a numeric picture specification. The KEYTO option can be used in a READ statement for a SEQUENTIAL INPUT or SEQUENTIAL UPDATE file.

The KEYTO option applies only to KEYED files.

Assignment to the KEYTO variable always follows assignment to the INTO variable. If an incorrect key specification is detected, the KEY condition is raised. The value assigned is as follows:

The KEY condition is not raised for this type of padding or truncation.

The following example specifies that the next record in the file Detail is read into the variable Invntry, and that the key of the record is assigned to the variable Keyfld:

  read file (Detail) into (Invntry) keyto (Keyfld);

Terms of use | Feedback

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