Can someone please explain the difference between Disp=Mod and Disp=old
When you allocate a Data Set with DISP=MOD and the program produce a abend, you don´t knew if some Data is written to the Data Set or not.
It´s better you create a new Data Set and write on it.
After a successful completion of the Step, you copy the original DS to a new DS.
Then you copy this 2 new Data Sets concatenated (DISP=SHR) with DISP=OLD over the old original Data Set.
Now you can delete the 2 new Data Sets.
MOD is a perfectly good choice for certain requirements.
If you want to append to existing data, MOD will allow this.
If you have housekeeping JCL that terminates with FILE NOT FOUND, MOD may be able to prevent this. If MOD is used, a new file will be created if it does not exist. An existing file will be used when it already exists.
Suggest everyone in this topic read about MOD in the JCL Reference Manual.
Both the options gives us status of the data-set ie dataset is already existed. In MOD is used to append the record at end and OLD is used while updated dataset with exclusive control over the dataset.
Yes, MOD can be used to append, but it can also be used to create a new file.
Your info is incomplete at best.