Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

DISP=OLD/SHR/NEW/MOD for PDSes

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10231
Location: italy

PostPosted: Tue Mar 08, 2011 12:16 pm    Post subject: DISP=OLD/SHR/NEW/MOD for PDSes
Reply with quote

found this interesting post on IBM-MAIN
due thanks and recognition to Chris Mason for it
snipped here and there ...

Quote:
From: Chris Mason <chrismason@BELGACOM.NET>
Subject: Re: [IBM-MAIN] Difference between DISP=NEW and MOD for a PDS member?
Date: 05 marzo 2011 10.27.17 GMT+01.00
To: IBM-MAIN@bama.ua.edu
Reply-To: IBM Mainframe Discussion List <IBM-MAIN@bama.ua.edu>


Quote:
I' ve tried to develop a complete story in part based on the above extract from
the z/OS V1R12 MVS JCL Reference, SA22-7597-14, "12.19.8 Disposition of
Partitioned Data Sets (PDSs and PDSEs)":

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/IEA2B6A0/12.19.8

I start with the simpler case of a sequential data set and go on to a PDS
without a member name specified finishing with a PDS with a member name
specified.

Code:
It's very much a requirement that these tables be viewed with a non-
proportional font of course.

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 or immediate EOF
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 or immediate EOF
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
---------------------------------------------
| pass     | pass     | fail     | fail     | 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        | -------- | -------- | data set does exist but member does not exist
---------------------------------------------
| -------- | -------- | 2        | 2        | data set does exist and member does exist
---------------------------------------------

1 - error or immediate EOF
2 - normal with QSAM

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

2 - normal with QSAM
6 - apparently normal with QSAM but resulting data set is corrupted
7 - normal with QSAM and member replaced

My first crack at this tried to give some credence to the assertion provided by
Radoslaw Skorupka that DISP always applies to the data set. Then I
discovered that the only way to make sense of the section quoted by Gerhard
Adam is to assume that

- DISP=NEW/MOD insists that the member does not exist irrespective of
whether or not a partitioned data set exists

- DISP=OLD/SHR insists that the member does exist and obviously the
partitioned data set exists

which wasted a lot of time but there we are ...

Going back to the original question, where a PDS is involved and a member
name is specified, DISP=MOD has no special qualities not possessed by
DISP=NEW in terms of being accepted in JCL.

However, once accepted it looks as if DISP=MOD and "output" is very likely to
make a mess of the partitioned data set in the case where a member name is
specified and also in the case where a member name is not specified.

Bad news all round!


Quote:
Please those who understand the topic more deeply than I amend as
necessary and repost. For example, I am not sure over whether my "1" is an
error or regarded as normal but an immediate "end-of-file".

This is an opportunity for those who promote testing and have a "sandbox" to
hand to show their mettle! Certainly if this had come up twelve years ago or
more, I would be reporting test results rather that attempting to work it all
out theoretically with assistance from the manuals.

Note that DISP=OLD is always the same as DISP=SHR in these diagrams but
anyone running through tests might like to verify this.

-

It's because it is so difficult to be able to find circumstances where a JCL
failure applies to DISP=MOD that I'm paying any attention to this thread. I
have used the "trick" that DISP=MOD is just immune to ever being the cause
of a JCL error - with the exception, easily avoided, described above - as a
way to ensure a data set is deleted before allocating the data set anew in a
following step. This is a way of setting up trace and dump data sets without
running the risk that they may or may not exist prior to running the job. This is
usually combined with allocating a trivial amount as a primary and something
more substantial as a secondary - with "release" of course - in the job step
which may need the trace or dump data set.

This is an approach which fits education/test systems but may not suit
production systems.

There was also often a need to take SYST out of the PPT attributes because
of the multiple job step limitation and add TIME=1440 to the step that
mattered, of course.

Chris Mason
Back to top
View user's profile Send private message

View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Updating a VSAM file with DISP=OLD sheersh JCL & VSAM 8 Tue Mar 14, 2017 6:14 pm
No new posts DISP=(SHR,PASS) performance opinion steve-myers JCL & VSAM 1 Wed Dec 02, 2015 11:53 pm
No new posts Question about DISP=MOD harifsheik JCL & VSAM 3 Tue Jun 16, 2015 2:39 pm
No new posts DISP parameters spoorni JCL & VSAM 8 Tue Jul 22, 2014 3:42 am
No new posts SAS - Temp dataset with DISP=MOD vasanthz All Other Mainframe Topics 3 Tue Jun 24, 2014 2:00 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us