what disp parameter can be used?

JES2/3, JCL, utilities.
Post Reply
Maven JJ
Registered Member
Posts: 14
Joined: Thu May 19, 2016 3:36 pm

what disp parameter can be used?

Post by Maven JJ »

Hi,

I have a step that passes data from input to output file my output file should created newly and next my job runs i dont want to change any of the disp parameters..So can please suggest what disp parameter i can use
Abbey Tiwari
Registered Member
Posts: 21
Joined: Mon Jan 18, 2016 8:16 am

Re: what disp parameter can be used?

Post by Abbey Tiwari »

Probably you want to know which DISP can be used in two steps where at one step it works in OUTPUT mode and in other step as INPUT: It’s MOD but keep in mind when you will run job second time first step will append data at bottom instead of writing altogether new from first line
Maven JJ
Registered Member
Posts: 14
Joined: Thu May 19, 2016 3:36 pm

Re: what disp parameter can be used?

Post by Maven JJ »

Abbey Tiwari wrote: Mon Aug 07, 2023 5:09 pm Probably you want to know which DISP can be used in two steps where at one step it works in OUTPUT mode and in other step as INPUT: It’s MOD but keep in mind when you will run job second time first step will append data at bottom instead of writing altogether new from first line
What if I want to overwrite the data when I run job 2times .what disp parameter will use or how it can be achieved?
User avatar
zum13
Registered Member
Posts: 85
Joined: Thu May 04, 2023 12:58 am

Re: what disp parameter can be used?

Post by zum13 »

DISP=NEW doesn't tolerate the dataset already existing, so assuming your job is a single step that takes an input dataset, processes it and writes the output dataset as new, the job will fail on the second run. The way to avoid this is to put in an initial step that deletes the dataset first:

Code: Select all

//STEP1  EXEC PGM=IEFBR14
//DD01     DD DSN=your.output.dataset,DISP=(MOD,DELETE,DELETE),
//            SPACE=(TRK,0),RECFM=xx,LRECL=yyy
This will temporarily allocate the dataset and delete it if it's not there, or it will delete the dataset if it is there. The DISP=NEW in the following step should then work both on the first run and any subsequent re-runs.
Maven JJ
Registered Member
Posts: 14
Joined: Thu May 19, 2016 3:36 pm

Re: what disp parameter can be used?

Post by Maven JJ »

Thanks zum13. This works.

I'll keep posted in case our requirements changes.

What does zum13 means?
Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Return to “JCL - Job Control Language.”