Page 1 of 1

Merging two files record by record.

Posted: Mon May 15, 2017 12:18 pm
by Sachin Kumar
Hi,

I want to merge the two records but the catch is that the records are from two different files. So it is like this:

File-1 is like - MY.FILE.ONE have the data "firstfiledata" and it's of length 80.
File-2 is like - MY.FILE.TWO have the data "secondfiledata" and it's of length 80.

I want my output file should be as: "firstfiledatasecondfiledata".

How can I do this, please help me on this.

Re: Merging two files record by record.

Posted: Mon May 15, 2017 3:30 pm
by nicc
Use joinkeys - examples abound. And you do NOT have files - you have DATA SETS.

Re: Merging two files record by record.

Posted: Tue May 16, 2017 11:16 pm
by zprogrammer
Alternatively you could also use WHEN=GROUP + Records=2

Re: Merging two files record by record.

Posted: Thu May 18, 2017 1:47 pm
by Sachin Kumar
nicc wrote: Use joinkeys - examples abound. And you do NOT have files - you have DATA SETS.
Thanks Nic. I have found example of JOINKEYS for selecting duplicate records but could not find a similar example like mine. Will search again.

Re: Merging two files record by record.

Posted: Thu May 18, 2017 1:48 pm
by Sachin Kumar
zprogrammer wrote: Alternatively you could also use WHEN=GROUP + Records=2
I couldnot follow your instruction, could you please guide again?

Re: Merging two files record by record.

Posted: Thu May 18, 2017 4:20 pm
by nicc
If you want something more specific then you need to give more details on your data - is there a 1-to- correlation between the records in data set 1 and the records in data set 2? If not - how are they to be matched? What are the key fields? Presumably your output data set is to be RECFM=FB and LRECL=160?