DISP Parameter

If the DISP parameter for a dataset is DISP=(NEW,PASS,CATLG), What will happen when the JCL is run? The first time? The second time?

Questions by Mainframer18   answers by Mainframer18

Showing Answers 1 - 24 of 24 Answers

arun442

  • Aug 17th, 2008
 

In such case first time a new folder/file will be created and if succesful completion of programme is there then that program will be passed otherwise the JCL program will be catalogue, in this case.

A new dataset will be created first . For successful execution of the program the dataset will be passed to next step in the Job . For unsuccessful execution of the program the dataset will be cataloged

  Was this answer useful?  Yes

raghu_k213

  • Nov 15th, 2008
 

For the 1st time if the job execute successful then data set will be created and then passed to the next step. If the job abbends then it will catalog.
For the 2nd execution it will show that duplicate data set name.

  Was this answer useful?  Yes

In each run first run of JOB, if the JOB abends the data set will be cataloged and in second run it will give JCP ERROR ( Data set already cataloged). While if in the first run JOB ,it runs successfully data set will be created temporarily to be used by another steps in the same JOB but at the end of the JOB data set will not be there, because it is not cataloged.

dhs01

  • Apr 15th, 2009
 

Almost correct.

DISP=(NEW,PASS,CATLG),
The results depend on the data set not the run.
If the data set currently exists, it would then depend on where it was being allocated. If the allocation was to the same dasd as the current one, you would get a jcl error. If it were being allocated to a different dasd, your job could run. If the step runs sucessfully, the data set disposition would be determined by subsequent steps with the default being delete. If the step abends, the data set would be cataloged unless there was a previously cataloged data set by that name in which case it would be kept and you would get a not catlg 2.

DISP= (new, pass, catlg)

if we look at the parameter 'PASS' per se, its used for temp datasets, so the dataset wont be retained after the job completes fine.

So now we have two scenerios here.

1. First run completes fine.
2. first run is abend.

1. First run completes fine: in this case the dataset would not be retained after the job completion, therefore the second run would not be a problem.

2. First run is abend: in this case since our last parameter says 'CATLG', it would be present and therefore, second run the same job will give problems.  So in this case we need to either change the disposition or delete the dataset before the second run.

suggestions welcome !!


Dave

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions