DISP for PDS and PS.

JES2/3, JCL, utilities.
User avatar

Topic author
BobThomas
Registered Member
Posts: 72
Joined: Sat Jun 15, 2013 11:04 am
Has thanked: 14 times

DISP for PDS and PS.

Postby BobThomas » Tue Mar 25, 2014 8:01 pm

Hi,

Does DISP parameter behave differently for PDS and PS? For example, if we have to create a new member in existing PDS, the DIDP is not NEW...




William Collins
Global Moderator
Global Moderator
Posts: 499
Joined: Sun Aug 25, 2013 7:24 pm
Has thanked: 1 time
Been thanked: 25 times

Re: DISP for PDS and PS.

Postby William Collins » Tue Mar 25, 2014 9:20 pm

Correct, for a new member the DISP is not NEW, because the dataset already exists, it is simply new content in an existing dataset.



User avatar

Topic author
BobThomas
Registered Member
Posts: 72
Joined: Sat Jun 15, 2013 11:04 am
Has thanked: 14 times

Re: DISP for PDS and PS.

Postby BobThomas » Wed Mar 26, 2014 1:25 pm

Okay Thanks. So basically the DISP is applcable to PDS and not to the member, yeah?



User avatar

Anuj Dhawan
Founder
Posts: 2393
Joined: Sun Apr 21, 2013 7:40 pm
Location: Mumbai, India
Has thanked: 152 times
Been thanked: 66 times

Re: DISP for PDS and PS.

Postby Anuj Dhawan » Wed Mar 26, 2014 2:04 pm

That's correct. As William has said, as PDS already exists and that's what zOS is looking at.

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.

When you specify DISP=SHR for a partitioned data set extended (PDSE) and also specify a member name, then:

If the member name exists, the member can have one writer or be shared by multiple readers, or
If the member name does not exist, the member can be added to the data set. Thus, multiple jobs can access different members of the data set and add new members to the data set concurrently — but concurrent update access to a specific member (or update and read by other jobs) is not valid.


Thanks,
Anuj

User avatar

Topic author
BobThomas
Registered Member
Posts: 72
Joined: Sat Jun 15, 2013 11:04 am
Has thanked: 14 times

Re: DISP for PDS and PS.

Postby BobThomas » Mon Mar 07, 2016 2:28 pm

Anuj Dhawan wrote:That's correct. As William has said, as PDS already exists and that's what zOS is looking at.

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 replace s 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.

When you specify DISP=SHR for a partitioned data set extended (PDSE) and also specify a member name, then:

If the member name exists, the member can have one writer or be shared by multiple readers, or
If the member name does not exist, the member can be added to the data set. Thus, multiple jobs can access different members of the data set and add new members to the data set concurrently — but concurrent update access to a specific member (or update and read by other jobs) is not valid.



Thanks for the explanation!



User avatar

Anuj Dhawan
Founder
Posts: 2393
Joined: Sun Apr 21, 2013 7:40 pm
Location: Mumbai, India
Has thanked: 152 times
Been thanked: 66 times

Re: DISP for PDS and PS.

Postby Anuj Dhawan » Tue Mar 08, 2016 8:19 pm

You're welcome. Hope you've got the answer! :)


Thanks,
Anuj


Return to “JCL - Job Control Language.”

Who is online

Users browsing this forum: CommonCrawl [Bot] and 1 guest