Page 1 of 1

Disp = MOD

PostPosted: Tue Aug 31, 2010 9:15 pm
by Vineet
Hi All,

I am having a Sequential File,Thru COBOL Pgm. I am Processing & writining Records To the File. If Job Abends then Records Should get written to the File & when I restart the Job from Abended Step, Records which are not processed
Should get Added to The File. For This I am Using Disp = (MOD,CATLG,CATLG). Please Confirm from COBOL side do I Need to Open the File in Extend Mode Or Output Mode will also work. My Understanding is EXTEND Mode. Please Confirm If I am wrong.

Thanks
Kind Rgds

Re: Disp = MOD

PostPosted: Tue Aug 31, 2010 10:07 pm
by steve-myers
"Extend" mode in OPEN is certainly an option for Assembler programmers; I don't know what its meaning is for Cobol. When an Assembler programmer specifies EXTEND as an OPEN option, it is equivalent to specifying DISP=MOD in JCL. I suspect it has the same meaning for Cobol, but I'm not a Cobol user.

It may not be a good idea. Many sites forbid the use of DISP=MOD for tape data sets, so if your data finds its way to tape your processing logic won't work. In addition, DISP=MOD is not allowed for data sets with the FBS or VBS record formats, which may be an issue in the future. Finally, if your data becomes a member of a PDS, DISP=MOD will not work the way you might expect; an attempt to use it will delete the original member without telling you.

Re: Disp = MOD

PostPosted: Tue Aug 31, 2010 11:48 pm
by dick scherrer
Hello,

If you intend to MOD onto an existing file, you need to make a copy of the data before the MODding begins (each time a new set of data is to be appended).

If there is an abend, simply copy the backup over the damaged original file and restart the process from the beginning.