Radoslaw

> Yes, DISP=NEW fails if the PDS already exists. Even if nonexistent member is 
specified.

I'm assuming that what you mean to say is the following:

"Yes, DISP=NEW fails if the PDS already exists and a member name is 
specified, even if a non-existent member is specified."

In fact, the post to which you are actually responding 

- had the virtue of brevity so could appeal to short attention spans - and I'm 
not accusing you of that - it's just that I've tried to make the point in a few 
posts and been ignored

- has the vice of not being properly hedged with the qualification "if what is 
implied by the manual is to be believed" but then, to have ameliorated that 
vice, would have impinged on the virtue!

Anyhow thanks very much for having demonstrated that what is implied in the 
manual is *not* to be believed with a test.

I hope you noted in an earlier post that I tried to take your route but 
committed the heinous crime of actually believing what the manual implied. Will 
I ever learn? Unfortunately I don't have a "sandbox" these days so these 
suspect documents are all I have to try to clarify these sorts of matters. 

What this indicates is that the section of the manual to which Gerhard Adam 
directed us is fatally wrong.

Which could be used as an answer to Gerhard's question:

>...> Has it occurred to anyone to just look at the JCL Reference manual?

Maybe "Yes, but I don't trust what the JCL Reference manual tells me so I'm 
asking for help from someone who really knows."

I propose a rewriting as follows:

<current text>

When you specify DISP=MOD or DISP=NEW for a partitioned data set (PDS) or 
partitioned data set extended (PDSE), and you also specify a member name in 
the DSNAME parameter, the member name must not already exist. If the 
member name already exists, the system terminates the job. 

When you specify DISP=OLD for a PDS or a PDSE, and you also specify a 
member name in the DSNAME parameter, the data set must already exist. If 
the member name already exists and the data set is opened for output, the 
system replaces the existing member with the new member. If the member 
name does not already exist and the data set is opened for output, the 
system adds the member to the data set. 

When you specify DISP=MOD for a PDS or a PDSE, and you do not specify a 
member name, the system positions the read/write mechanism at the end of 
the data set. The system does not make an automatic entry into the 
directory. 

When you specify DISP=MOD for a PDS or a PDSE, and you do specify a 
member name, the system positions the read/write mechanism at the end of 
the data set. If the member name already exists, the system terminates the 
job. 

</current text>

<proposed text>

When you specify DISP=NEW for a partitioned data set (PDS) or partitioned 
data set extended (PDSE) and you also specify a member name in the 
DSNAME parameter, naturally neither the data set nor the member exist.[1] If 
the data set is opened for output, the system adds the member to the data 
set. 

When you specify DISP=MOD for a PDS or PDSE and you also specify a 
member name in the DSNAME parameter, the data set may exist but, if the 
data set already exists, the member must not already exist. (If the member 
already exists, the system terminates the job.) If the data set is opened for 
output, the system adds the member to the data set. 

When you specify DISP=MOD for a PDS or a PDSE, the system positions the 
read/write mechanism at the end of the data set.

When you specify DISP=MOD for a PDS or a PDSE, and you do not specify a 
member name in the DSNAME parameter and the data set exists, the system 
does not make an automatic entry into the directory.

When you specify DISP=OLD for a PDS or a PDSE and you also specify a 
member name in the DSNAME parameter, the data set must already exist. If 
the member name already exists and the data set is opened for output, the 
system replaces the existing member with the new member. If the member 
name does not already exist and the data set is opened for output, the 
system adds the member to the data set. 

[1] Initially. However, if, during execution, a data set is created thereby 
creating a member having the specified name and then there is an attempt to 
create another data which would, if allowed to proceed create a member 
replacing the previous member, that attempt will fail.

</proposed text>

I've fixed up not only the first paragraph, the one that is so ridiculously 
wrong, 
but also the rest in order to be just a bit clearer and I have tried to 
maintain a 
pattern which should provide assurance that the description is more 
comprehensive.

The sentence regarding the "automatic entry" is a bit of a mystery since I find 
no other reference to something like this anywhere else in either of the JCL 
manuals.

Also I'm not sure that the "read/write mechanism" comment belongs here. I've 
a suspicion that the manual author was asked to slip in a comment like this 
wherever DISP=MOD was mentioned in the manual.

Note that I added the footnote in order to deal with the peculiar case 
mentioned by Charles Mills of the data set being opened twice with a member 
having been created on the first occasion. It - sort-of - makes sense if the 
second attempt is output but I'm less convinced if the second attempt is 
input. This "bending over backwards" to try to justify that first paragraph is 
probably not very productive!

-

And here is my set of diagrams with your correction included and well as the 
adjustment regarding "error or immediate EOF" which should be purely "error" - 
and, now matters are clearer, an adjustment to the DISP=OLD/SHR columns in 
the case of a PDS with member name specified:

Sequential
----------

JCL

---------------------------------------------
| DISP=NEW | DISP=MOD | DISP=OLD | DISP=SHR |
---------------------------------------------
| pass     | pass     | fail     | fail     | data set does not exist
---------------------------------------------
| fail     | pass     | pass     | pass     | data set does exist
---------------------------------------------

Input

---------------------------------------------
| DISP=NEW | DISP=MOD | DISP=OLD | DISP=SHR |
---------------------------------------------
| 1        | 1        | -------- | -------- | data set does not exist
---------------------------------------------
| -------- | 2        | 2        | 2        | data set does exist
---------------------------------------------

 1 - error
 2 - normal with QSAM

Output

---------------------------------------------
| DISP=NEW | DISP=MOD | DISP=OLD | DISP=SHR |
---------------------------------------------
| 2        | 2        | -------- | -------- | data set does not exist
---------------------------------------------
| -------- | 3        | 2        | 2        | data set does exist
---------------------------------------------

 2 - normal with QSAM
 3 - normal with QSAM and data appended

PDS with no member name specified
---------------------------------

JCL

---------------------------------------------
| DISP=NEW | DISP=MOD | DISP=OLD | DISP=SHR |
---------------------------------------------
| pass     | pass     | fail     | fail     | data set does not exist
---------------------------------------------
| fail     | pass     | pass     | pass     | data set does exist
---------------------------------------------

Note: identical to sequential

Input

---------------------------------------------
| DISP=NEW | DISP=MOD | DISP=OLD | DISP=SHR |
---------------------------------------------
| 1        | 1        | -------- | -------- | data set does not exist
---------------------------------------------
| -------- | 4        | 4        | 4        | data set does exist
---------------------------------------------

 1 - error
 4 - programming for PDS structure

Output

---------------------------------------------
| DISP=NEW | DISP=MOD | DISP=OLD | DISP=SHR |
---------------------------------------------
| 5        | 5        | -------- | -------- | data set does not exist
---------------------------------------------
| -------- | 6        | 5        | 5        | data set does exist
---------------------------------------------

 5 - apparently normal with QSAM but creates a sequential data set - or - 
programming for PDS structure
 6 - apparently normal with QSAM but resulting data set is corrupted

PDS with member name specified
------------------------------

JCL

---------------------------------------------
| DISP=NEW | DISP=MOD | DISP=OLD | DISP=SHR |
---------------------------------------------
| pass     | pass     | fail     | fail     | data set does not exist
---------------------------------------------
| fail     | pass     | pass     | pass     | data set does exist but member 
does 
not exist
---------------------------------------------
| fail     | fail     | pass     | pass     | data set does exist and member 
does 
exist
---------------------------------------------

Input

---------------------------------------------
| DISP=NEW | DISP=MOD | DISP=OLD | DISP=SHR |
---------------------------------------------
| 1        | 1        | -------- | -------- | data set does not exist
---------------------------------------------
| -------- | 1        | 1        | 1        | data set does exist but member 
does 
not exist
---------------------------------------------
| -------- | -------- | 2        | 2        | data set does exist and member 
does exist
---------------------------------------------

 1 - error
 2 - normal with QSAM

Output

---------------------------------------------
| DISP=NEW | DISP=MOD | DISP=OLD | DISP=SHR |
---------------------------------------------
| 7        | 7        | -------- | -------- | data set does not exist
---------------------------------------------
| -------- | 7        | 7        | 7        | data set does exist but member 
does 
not exist
---------------------------------------------
| -------- | -------- | 8        | 8        | data set does exist and member 
does exist
---------------------------------------------

 7 - normal with QSAM and member added
 8 - normal with QSAM and member replaced

-

It would be a great service to me anyhow and possibly to all interested parties 
to go through this set of options in your "sandbox" to verify what is proposed 
and even to fill in the actual abend codes where appropriate or to note, in the 
error cases, how the error is manifest.

As far as JCL is concerned, I don't think we need to know anything other than 
pass or fail but I leave it up to you.

It is also clear now - assuming all this is about correct - that, despite some 
contention to the contrary, there *is* a distinction between DISP=NEW and 
DISP=MOD behaviour in the case of a PDS when a member name is specified.

-

Chris Mason

On Sun, 6 Mar 2011 11:16:05 +0100, R.S. 
<[email protected]> wrote:

>W dniu 2011-03-06 05:41, Chris Mason pisze:
>> Charles
>>
>> The bottom line lacks copper.
>>
>>> DISP=NEW fails if the PDS already exists
>>
>> Not if the name of a non-existent member is specified.
>
>Yes, DISP=NEW fails if the PDS already exists. Even if nonexistent
>member is specified.
>At least my poor z/OS claims so. (Read: I just tested it).
>
>And I dare to repeat: DISP is always for dataset, not for the member.
>That's what we observe everyday: DELETE deletes PDS(E), NEW requires
>SPACE and creates new PDS(E) on disk.
>--
>Radoslaw Skorupka

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

Reply via email to