what is the point of WRITE KEYTO?

HLASM for MVS. PL/I for MVS & Enterprise PL/I for z/OS.

Topic author
peeterjoot
New Member
Posts: 8
Joined: Fri Mar 03, 2017 2:01 am
Has thanked: 4 times
Been thanked: 1 time

what is the point of WRITE KEYTO?

Postby 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: 105
Joined: Tue Oct 20, 2015 3:20 am
Location: Bloomington, IL
Has thanked: 2 times
Been thanked: 14 times

Re: what is the point of WRITE KEYTO?

Postby 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: 1267
Joined: Fri Jun 28, 2013 1:22 am
Location: East Dubuque Illinois
Has thanked: 2 times
Been thanked: 90 times

Re: what is the point of WRITE KEYTO?

Postby 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
New Member
Posts: 8
Joined: Fri Mar 03, 2017 2:01 am
Has thanked: 4 times
Been thanked: 1 time

Re: what is the point of WRITE KEYTO?

Postby peeterjoot » Thu Jun 08, 2017 9:53 pm

Akatsukami wrote:Source of the post 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.




Return to “Assembler & PL/I.”

Who is online

Users browsing this forum: No registered users and 0 guests