Joined: 14 Jun 2006 Posts: 331 Location: Jacksonville, FL
DISP=(PART1,PART2,PART3)
PART1 can be OLD - file must exist and you have exclusive control of the dataset, that is, nobody else can read the file while you are using it.
PART1 can be SHR - file must exist and all others may READ it at the same time you are reading it (they must have SHR as well)
PART1 can be MOD - file must exist and you will be adding on to the end of the file.
PART1 can be NEW - you are creating the file for the 1st time.
PART2 can be KEEP - This would assume the dataset is already catalogued and would probably be used with DISP=(OLD,KEEP)
PART2 can be CATLG - This would assume the dataset is new and once the job step ends that created the dataset, it would be catalogued.
PART2 can be DELETE - This would mean the dataset would be deleted after the job step ends.
PART2 can be PASS - This would usually be used with creating a temporary datasets so it can be passed and read in to subsequent steps.
PART2 can be UNCATLG - Rarely used.
When PART3 is coded, it tells the system what to do with your dataset in the event your job abnormally terminates.
PART3 can be KEEP - This would assume the dataset is already catalogued and the dataset would kept after an abnormal termination.
PART3 can be CATLG - This would assume the dataset is new and if the job step abnormally terminates, it would be catalogued.
PART3 can be DELETE - This would mean the dataset would be deleted in the event of an abnormal termination.
PART3 can be UNCATLG - Rarely used.
So DISP=(OLD,DELETE,DELETE) means READ an existing dataset and delete the dataset at the end the job step, regardless of whether the step abnormally terminated or not.
DISP=(MOD,DELETE,DELETE) means write to the end of an existing dataset and delete the dataset at the end the job step, regardless of whether the step abnormally terminated or not. This disposition doesn't make alot of sense, because why would you want to delete a dataset you just mod'ed onto.
if dataset is already cataloged
then no difference b/w disp=(old,delete,delete) and disp=(mod,delete,delete).
step runs successfully with same results(dataset deleted)
but if dataset not present then
disp=(old,delete,delete)
this will give JCL Error .
disp=(mod,delete,delete)
this will run successfully .
I haven't tested this but i think this is the main difference .
If FIle is NOT present and :
Disp=(OLD,DELETE,DELETE) - job will fail with JCL error
If FIle is present and :
Disp=(OLD,DELETE,DELETE) - job will run, file deleted
&
If FIle is NOT present
Disp=(MOD,DELETE,DELETE) - job will execute succesfully as MOD will create that file( for this we give SPACE parameter)
If FIle is NOT present
Disp=(MOD,DELETE,DELETE) with out SPACE parameter- job will fail with JCL error