Don

It turns out there is some amazing sophistry which can explain the grin on the 
non-existent Cheshire Cat!

The copper-bottomed line is that, indeed, all suboperands of DISP relate to 
the data set and, in that case where the DSNAME specifies a member, none of 
the suboperands of DISP relate to the member.

That confusing paragraph which implied that a data set could exist already 
with DISP=NEW - or why was the existence or otherwise of the member 
pertinent - can be explained as follows:

- Let us say the program wants to open and close the data set N times and at 
least the first time one or more records (blocks) are written.

-- If DISP=OLD or DISP=SHR is specified and the data set (pds) exists already, 
this is fine.

-- If DISP=NEW is specified and the data set didn't exist already, the 
first "open and close" will work, but the second open causes a failure since 
now the member exists.

-- If DISP=MOD is specified and the data set didn't exist already, the 
first "open and close" will work, but the second open causes a failure since 
now the member exists.

-- If DISP=MOD is specified and the data set existed already but the member 
didn't exist, the first "open and close" will work, but the second open causes 
a 
failure since now the member exists.

-- If DISP=MOD is specified, the data set existed already and the member 
existed already, the first open causes a failure since the member exists.

For convenience, here's that pesky paragraph again:

<quote>

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. 

</quote>

Charles Mills did hint at this earlier but I'm afraid I missed his point.

Of course, why this should be a problem is not clear - or not to me anyhow - 
and when something like this isn't clear it behoves the developers to explain 
themselves - and sometimes they do, sometimes they don't!

Chris Mason

On Sun, 6 Mar 2011 09:49:03 -0500, Don Williams <donb...@gmail.com> 
wrote:

>When I replied with my "simple" answer, I had not seen the part of thread
>referring to product being written. Over the years, I have had to restore
>many PDSes when a naïve user coded DISP=(MOD,DELETE). Sorry, I'm biased 
with
>trying to make sure that most people view, in general, DISP as a dataset
>level parameter. However, in this case the nuances of the DISP parameter are
>important.
>
>Don
>
>-----Original Message-----
>From: IBM Mainframe Discussion List [mailto:IBM-MAIN@bama.ua.edu] On 
Behalf
>Of Chris Mason
>Sent: Saturday, March 05, 2011 11:44 PM
>To: IBM-MAIN@bama.ua.edu
>Subject: Re: Difference between DISP=NEW and MOD for a PDS member?
>
>Don
>
>> The simple answer:
>
>This is not a topic for people who need "simple answers"!
>
>When I said
>
>>...> DISP=NEW/MOD insists that the member does not exist irrespective of
>whether or not a partitioned data set exists
>
>obviously I was concentrating on the only on first suboperand of the DISP
>operand.
>
>It seems we must take a different perspective according to whether we are
>dealing with the first suboperand or the second and third suboperands - not
>at
>all "simple"!
>
>> The DISP parameter is for the data set/library and not members.
>
>Apparently not so in the case of the first suboperand.
>
>If a member name is specified, the first suboperand relates to the member
>and
>appears not to care about the data set. Otherwise why make a fuss about
>whether a member exists or not in a data set that can't be there to contain
>the member - which may or may not be there - if the data set is not 
supposed
>
>to exist - in the case of DISP=NEW anyhow. There's something of the
>Cheshire Cat about this!
>
>Here, once again for your delectation, is the first paragraph of the
>section "12.19.8 Disposition of Partitioned Data Sets (PDSs and PDSEs)" from
>
>the z/OS V1R12 MVS JCL Reference manual:
>
>http://publibz.boulder.ibm.com/cgi-
>bin/bookmgr_OS390/BOOKS/IEA2B6A0/12.19.8
>
><quote>
>
>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.
>
></quote>
>
>If you can explain this away, I'll accept your "simple" contention also
>regarding
>the first suboperand.
>
>> For example, DSN=MY.LIBRARY(MYMEM),DISP=(OLD,DELETE) deletes the
>library and not just the member.
>
>Assuming you verified your example rather than just composing it in order to
>
>illustrate your point, it appears that the normal and abnormal termination
>disposition suboperands do indeed apply to the data set irrespective of
>whether or not a member name is specified. I checked the z/OS V1R12 MVS
>JCL Reference manual to try to be sure and there is certainly no mention of
>any variation based on whether or not a member name is specified so I guess
>an actual test would have been superfluous.
>
>http://publibz.boulder.ibm.com/cgi-
>bin/bookmgr_OS390/BOOKS/IEA2B6A0/12.19.2.2
>http://publibz.boulder.ibm.com/cgi-
>bin/bookmgr_OS390/BOOKS/IEA2B6A0/12.19.2.3
>
>Indeed, it's all getting a bit complex and the poor systems programmer who
>tried to delete a member using the DISP second suboperand can be forgiven -
>well by those who were not desperately relying on the partitioned data set,
>that is![1]
>
>-
>
>A modification to my previous post with the diagrams:
>
>In the case of a DISP=NEW data set or dataset(member) - and DISP=MOD if
>the entity has had no existence hitherto - it is an error not to write
>something. This makes my "error or immediate EOF" simply "error".
>An "immediate EOF" would be possible only if the data set - or a member I
>guess - had deliberately been created - "written to" - with 0 records.
>Alternatively I'll be happy to be corrected.
>
>-
>
>Chris Mason
>
>[1] This reminds me of an occasion when I keyed up a SCRATCH statement
>that was supposed to be coded as
>
>SCRATCH VTOC,VOL=2314=MYVOLM,SYS
>
>After that traumatic event, I resolved always to use the order
>
>SCRATCH VTOC,SYS,VOL=2314=MYVOLM
>
>because it turns out you can't always be sure that where you intended to 
key
>
>a comma, a comma actually got keyed!
>
>I remember even better because it was New Year's Eve and the was someone
>from north of the border in the overworked team.
>
>
>On Sat, 5 Mar 2011 15:12:41 -0500, Don Williams <donb...@gmail.com>
>wrote:
>
>>The simple answer: The DISP parameter is for the data set/library and not
>>members.
>>
>>For example, DSN=MY.LIBRARY(MYMEM),DISP=(OLD,DELETE) deletes the
>library and
>>not just the member.
>>
>>-----Original Message-----
>>From: IBM Mainframe Discussion List [mailto:IBM-MAIN@bama.ua.edu] On
>Behalf
>>Of Charles Mills
>>Sent: Friday, March 04, 2011 3:03 PM
>>To: IBM-MAIN@bama.ua.edu
>>Subject: Difference between DISP=NEW and MOD for a PDS member?
>>
>>What is the difference between DISP=NEW and DISP=MOD for a PDS member
>>(member name specified on the DD statement)?
>>
>>Both disallow duplicate member names. Are there any differences? What?
>>
>>Charles

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

Reply via email to