DISP=OLD also means that the file will be overwritten and the old data will disappear to be be replaced with new data. Disp=Mod means that new data will be added to the end of the file.
disp=old refers to dataset already created. if it not there means it wil show error .. disp=mod refers some data contents are added at end of dataset if dataset already present . if the data set not present means a new dataset is created.
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.
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.
Thanks
ShivAnand
4ShivAnand,
Yes, MOD can be used to append, but it can also be used to create a new file.
Your info is incomplete at best.