Compare two files and write output in 2 files



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

Compare two files and write output in 2 files

Postby ankurjain299 » Mon May 24, 2010 5:43 pm

Hi,
Could any one please help in below requirement using DFSORT

I have two input file (lets say file A and file B) both of same record length of 120
Format of both the files is like this:

PLAN BRANCH GROUP ASSOC BRKIND SN SUBNAME

999 00 099930 001 783784 NICHOLAS
911 00 099180 001 134545 SABINE TH
911 00 099180 001 134545 SABINE TH
999 00 099280 001 134325 DONALD W.
935 00 099580 001 266555 NYSSA H.
900 00 099540 001 X 356565 AIMEE N.
900 00 099480 001 X 356546 DIANE L.
935 00 099950 001 3456234 DANA M. H
900 00 099940 001 4245455 JONNA R.
900 00 099940 001 4657777 CARLY M.
900 00 099480 001 4634664 DAVID T.

File A contains duplicate records

What i want is
1) Remove all the records in file A with GROUP 099940
2) Sort file A with respect to PLAN and GROUP
3) After that remove All the duplicates from file A
4) Sort File B with respect to PLAN and GROUP
5) Now compare file A and File B and all the matching record has to be written in File C of same format and unmatched records in different file


Thanks in advance
ankurjain299
 
Posts: 1
Joined: Tue May 26, 2009 12:03 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Compare two files and write output in 2 files

Postby skolusu » Mon May 24, 2010 9:16 pm

ankurjain299,

Please see the Smart DFSORT trick "Create files with matching and non-matching records" here

http://www.ibm.com/support/docview.wss? ... g3T7000094
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
skolusu
 
Posts: 586
Joined: Wed Apr 02, 2008 10:38 pm
Has thanked: 0 time
Been thanked: 39 times


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post