IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

DISP=OLD / SHR / NEW / MOD for PDSe


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10886
Location: italy

PostPosted: Tue Mar 08, 2011 12:16 pm
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)":

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
praveenks1610

New User


Joined: 05 Aug 2010
Posts: 1
Location: Delhi

PostPosted: Tue May 22, 2018 4:22 pm
Reply with quote

2014.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts How to copy the -1 version of a membe... TSO/ISPF 4
No new posts what is the DSORG(Datset orgnisation)... JCL & VSAM 8
No new posts ISPF 3.4 edit of a ps file, disp use... TSO/ISPF 3
No new posts How to query MAXGENS of an existing P... JCL & VSAM 4
No new posts Updating a VSAM file with DISP=OLD JCL & VSAM 8
Search our Forums:

Back to Top