what is the point of WRITE KEYTO?

HLASM for MVS. PL/I for MVS & Enterprise PL/I for z/OS.
Post Reply
peeterjoot
Registered Member
Posts: 15
Joined: Fri Mar 03, 2017 2:01 am
Contact:

what is the point of WRITE KEYTO?

Post by peeterjoot »

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: 122
Joined: Tue Oct 20, 2015 3:20 am
Location: Bloomington, IL
Contact:

Re: what is the point of WRITE KEYTO?

Post by Akatsukami »

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: 1885
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

Re: what is the point of WRITE KEYTO?

Post by Robert Sample »

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.
peeterjoot
Registered Member
Posts: 15
Joined: Fri Mar 03, 2017 2:01 am
Contact:

Re: what is the point of WRITE KEYTO?

Post by peeterjoot »

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.
Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Return to “Assembler & PL/I.”