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
what disp parameter can be used?
-
- Registered Member
- Posts: 21
- Joined: Mon Jan 18, 2016 8:16 am
Re: what disp parameter can be used?
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
Re: what disp parameter can be used?
What if I want to overwrite the data when I run job 2times .what disp parameter will use or how it can be achieved?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
Re: what disp parameter can be used?
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:
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.
Code: Select all
//STEP1 EXEC PGM=IEFBR14
//DD01 DD DSN=your.output.dataset,DISP=(MOD,DELETE,DELETE),
// SPACE=(TRK,0),RECFM=xx,LRECL=yyy
Re: what disp parameter can be used?
Thanks zum13. This works.
I'll keep posted in case our requirements changes.
What does zum13 means?
I'll keep posted in case our requirements changes.
What does zum13 means?
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