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

All sort of Mainframes Interview Questions.
Post Reply
Krishna Veni
New Member
Posts: 1
Joined: Wed Aug 13, 2014 4:30 pm

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

Post 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.
zprogrammer
Global Moderator
Global Moderator
Posts: 588
Joined: Wed Nov 20, 2013 11:53 am
Location: Mars

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

Post by zprogrammer »

You could dummy the FILE2,FILE5,FILE9 and FILE15 and override the merged dataset as a new dataset.
zprogrammer
William Collins
Global Moderator
Global Moderator
Posts: 490
Joined: Sun Aug 25, 2013 7:24 pm

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

Post 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).
User avatar
Anuj Dhawan
Founder
Posts: 2802
Joined: Sun Apr 21, 2013 7:40 pm
Location: Mumbai, India
Contact:
India

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

Post 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.
Thanks,
Anuj

Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.
zprogrammer
Global Moderator
Global Moderator
Posts: 588
Joined: Wed Nov 20, 2013 11:53 am
Location: Mars

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

Post by zprogrammer »

Thanks for correction Anuj and Williams
zprogrammer
nicc
Global Moderator
Global Moderator
Posts: 691
Joined: Wed Apr 23, 2014 8:45 pm

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

Post 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
Regards
Nic
Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Return to “Interview Questions.”