chandra Beginner
Joined: 26 Sep 2003 Posts: 130 Topics: 36
|
Posted: Thu Oct 16, 2008 10:56 am Post subject: Merge multiple records to single record |
|
|
Hi All,
I have a file with LRECL=80, RECFM=FB and the input data as shown. The column 1 to 39 is key. column 40 will tell the sequence number for key.
----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
XZ41A1900110011979*****99999 0010000015000099999999999*** PRKY ENF 32A
XZ41A1900110011979*****99999 002C10000000000000000000 ** LANY8OU ** NOOA
XZ41A1900110011979*****99999 0119999999999999999999999*** FGW656IU78H FF
XZ41A1900110011979*****99999 012C01500000000000000000 &&& JAKJNN **AS
XZ41A1900110011979*****99999 013D0163456700000000000000000 GWYJ4TH 4545
XZ41A1900210151999*****04499 0210000015000099999999999***SJHRTU6U323565H
XZ41A1900210151999*****04499 022C00000000000000000000 0110011979*****9 *
XZ41A1900210151999*****04499 0310000030000099999999999*** FGHRHFS465735
XZ41A1900210151999*****04499 032C00000000000000000000 01100ACFGGEF*****9
XZ41A1900210151999*****04499 0330000045000099999999999***
XZ41A1900210151999*****04499 034C00000000000000000000 01100SFDREHG*****9
XZ41A1900210151999*****04499 0510000075000099999999999***
I want to merge same key records into single record as follows (Exclude the 40 the column)
Output :-
XZ41A1900110011979*****99999 0010000015000099999999999*** PRKY ENF 32AC10000000000000000000 ** LANY8OU ** NOOA
XZ41A1900110011979*****99999 0119999999999999999999999*** FGW656IU78H FFC01500000000000000000 &&& JAKJNN **ASD0163456700000000000000000 GWYJ4TH 4545
XZ41A1900210151999*****04499 0210000015000099999999999***SJHRTU6U323565HC00000000000000000000 0110011979*****9 *
XZ41A1900210151999*****04499 0310000030000099999999999*** FGHRHFS465735 C00000000000000000000 01100ACFGGEF*****90000045000099999999999*** C00000000000000000000 01100SFDREHG*****9
XZ41A1900210151999*****04499 0510000075000099999999999***
Can any one please let me know how to do it with SORT utility. I have SYNCSORT. _________________ Regards,
Chandra |
|