Posted: Tue Jul 22, 2008 4:05 am Post subject: Merge 2 files
Hi,
I want to merge files in a particular fashion
The first record should be from file1, second from file 2, 3rd from file1 and so on.
File1:
00000000000001000000000000000000000000
00000000000002000000000000000000000000
00000000000003000000000000000000000000
Joined: 20 Oct 2006 Posts: 1411 Topics: 26 Location: germany
Posted: Tue Jul 22, 2008 4:50 am Post subject:
why don't you spend some time searching the utilities forum, look at the stickies, etc? _________________ Dick Brenholtz
American living in Varel, Germany
Sorry i tried searching but could not find information related to my requirement.
It would be of great help if you can provide me the link. _________________ Thanks,
Hari
Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
Posted: Tue Jul 22, 2008 10:33 am Post subject:
Hari,
If the records in file1 and file2 actually have sequence numbers in 1-14 as shown, you could do a simple MERGE using the sequence numbers as the key like this:
_________________ Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Joined: 04 May 2003 Posts: 92 Topics: 4 Location: Paris, France
Posted: Tue Jul 22, 2008 11:02 am Post subject:
Hari,
Frank says
Quote:
If the records in file1 and file2 actually have sequence numbers in 1-14 as shown, you could do a simple MERGE using the sequence numbers as the key like this:
if the sequence number is not present as shown, I suppose we could presrve Frank's idea by concatenate the files and create an extra field using a INREC with SEQNUM and RESTART=(16,2) parameters (bold field) then MERGE based on this extra field.
Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
Posted: Tue Jul 22, 2008 3:26 pm Post subject:
Quote:
I think MERGE will not work. Sort card would be better...
You mean MERGE wouldn't work if the sequence numbers were not present and you had to generate them ... right? MERGE will work if the sequence numbers are present.
Quote:
if the sequence number is not present as shown, I suppose we could presrve Frank's idea by concatenate the files and create an extra field using a INREC with SEQNUM and RESTART=(16,2) parameters (bold field) then MERGE based on this extra field.
I think you mean 15,2 (00 in file1 or 01 in file2) but that assumes those values are really in the input records and the sequence numbers aren't. Possible I guess, but ... _________________ Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Joined: 04 May 2003 Posts: 92 Topics: 4 Location: Paris, France
Posted: Wed Jul 23, 2008 5:58 am Post subject:
Frank,
I talked about my post not yours
By MERGE will not work, I meant that it will not work if the files are concatenated. Replacing MERGE per a SORT card will do it.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum