Page 1 of 1

Merge some of the files out of many files in JCL?

Posted: Thu Nov 12, 2015 11:27 am
by Krishna Veni
Hello,

There is a catalogued procedure in which 15 files are concatenated. Now for some reason I need to merge some files in the same steps. For example, how to override these files such that file2, file5,file9 and file15 are merged?

I did not answer the question as I don't how to do it. Can someone suggest an answer.

Re: Merge some of the files out of many files in JCL?

Posted: Thu Nov 12, 2015 1:57 pm
by zprogrammer
You could dummy the FILE2,FILE5,FILE9 and FILE15 and override the merged dataset as a new dataset.

Re: Merge some of the files out of many files in JCL?

Posted: Thu Nov 12, 2015 2:15 pm
by William Collins
You can't use DUMMY or DSN=NULLFILE in a concatenation if it is followed by data that you want.

You'd have to override to a dataset with no records but with an end-of-file (been opened for output, and closed).

Re: Merge some of the files out of many files in JCL?

Posted: Thu Nov 12, 2015 2:45 pm
by Anuj Dhawan
I agree with William. Once you have DUMMY in the concatenated files, that's the 'end of file' - rest of the files in the concatenation, after the DUMMY, are ignored by the system.

Re: Merge some of the files out of many files in JCL?

Posted: Thu Nov 12, 2015 3:31 pm
by zprogrammer
Thanks for correction Anuj and Williams

Re: Merge some of the files out of many files in JCL?

Posted: Thu Nov 12, 2015 7:41 pm
by nicc
So, if you want to concatenate only datasets 2, 4, 9 and 15 you code them as the first four and the fifth is DUMMY:

Code: Select all

//DDNAME DD DSN=DATASET2,DISP=SHR
//       DD DSN=DATASET4,DISP=SHR
//       DD DSN=DATASET9,DISP=SHR
//       DD DSN=DATASET15,DISP=SHR
//       DD DUMMY