what is the point of WRITE KEYTO?

HLASM for MVS. PL/I for MVS & Enterprise PL/I for z/OS.
Previous topicNext topic

Topic Author
peeterjoot
Registered Member
Posts: 15
Joined: Fri Mar 03, 2017 2:01 am

what is the point of WRITE KEYTO?

Post by peeterjoot » Thu Jun 08, 2017 9:42 pm

I understand the point of the KEYFROM option in WRITE. For example I could do a VSAM write using:

WRITE FILE(myfile) KEYFROM(mykey) FROM(myrecord)

The Enterprise PL/I for z/OS Language Reference manual also specifies that a KEYTO() option is allowed for WRITE. What would that be used for?



User avatar

Akatsukami
Global Moderator
Global Moderator
Posts: 119
Joined: Tue Oct 20, 2015 3:20 am
Location: Bloomington, IL

Re: what is the point of WRITE KEYTO?

Post by Akatsukami » Thu Jun 08, 2017 9:48 pm

The Language Reference does not state that KEYTO can be used with WRITE, but rather with READ; see page 299.


"I come to the conclusion that, men loving according to their own will and fearing according to that of the prince, a wise prince should establish himself on that which is in his own control and not in that of others." -- Niccolò Machiavelli

User avatar

Robert Sample
Global Moderator
Global Moderator
Posts: 1340
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
Zodiac: Virgo

Re: what is the point of WRITE KEYTO?

Post by Robert Sample » Thu Jun 08, 2017 9:52 pm

From the version 5.1 Programming Guide page 295:
You can obtain the RBA for a record by using the KEYTO option, either on a WRITE statement when you are loading or extending the data set, or on a READ statement when the data set is being read. You can subsequently use an RBA obtained in either of these ways in the KEY option of a READ or REWRITE statement.




Topic Author
peeterjoot
Registered Member
Posts: 15
Joined: Fri Mar 03, 2017 2:01 am

Re: what is the point of WRITE KEYTO?

Post by peeterjoot » Thu Jun 08, 2017 9:53 pm

Akatsukami wrote: The Language Reference does not state that KEYTO can be used with WRITE, but rather with READ; see page 299.
On page 313, the syntax diagram shows:

►► WRITE FILE (file-reference) FROM (reference) ►

KEYFROM(expression)
KEYTO(reference)
You do not have the required permissions to view the files attached to this post.



Previous topicNext topic

Return to “Assembler & PL/I.”