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

KEYFROM option

The KEYFROM option specifies a character, graphic or widechar key that identifies the record on the data set to which the record is transmitted. It can be used in a WRITE statement for any KEYED OUTPUT or DIRECT UPDATE file, or in a LOCATE statement.

The KEYFROM option applies only to KEYED files. The expression is evaluated and, if not character, graphic or widechar, is converted to a character string and is used as the key of the record when it is written.

Relative data sets can be created using the KEYFROM option. The record number is specified as the key.

REGIONAL(1) data sets can be created using the KEYFROM option. The region number is specified as the key.

For indexed data sets, KEYFROM specifies a recorded key whose length must be equal to the key length specified for the data set.

The following example specifies that the value of Loanrec is written as a record in the file Loans, and that the character string value of Loanno is used as the key with which it can be retrieved:

  write file (Loans) from (Loanrec) keyfrom (Loanno);

Terms of use | Feedback

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