File Comparision.



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

File Comparision.

Postby Vineet » Wed Aug 13, 2014 11:56 pm

Hi All,
I am having 2 Sequential File A & B, both having LRECL = 80 & RECFM = FB. I want to compare both the Files for the 80 Bytes (Complete Record Length). If Record is Present in File A but not in File B then record to be written to O/P file, similarly if record is present in File B but not in File A record to be written to O/p File. If Record is present in Both the Files record to be bypassed. O/P file having LRECL = 80 & RECFM = FB. How to handle this using SORT. belos is example for Same.

File A:
123456789|ABCDEFGH|1234OPLKM
444444444|ABCDEFGH|1111OPLKM ----> To Be Written To O/p File
555555555|ABCDEFGH|2222OPLKM ----> To Be Written To O/p File
666666666|ABCDEFGH|13333PLKM
777777777|LOMNVP12|98765AQNO ----> To Be Written To O/p File


File B:
123456789|ABCDEFGH|1234OPLKM
444444444|ABCD1234|1111OPLKM ----> To Be Written To O/p File
555555555|ABCD4444|2222OPLKM ----> To Be Written To O/p File
666666666|ABCDEFGH|13333PLKM

Thanks
Vineet
 
Posts: 86
Joined: Tue Jun 19, 2007 11:38 am
Has thanked: 0 time
Been thanked: 0 time

Re: File Comparision.

Postby BillyBoyo » Thu Aug 14, 2014 1:16 am

JOINKEYS, specify SORTED,NOSEQCK if the data is indeed in order as you show. Key of 80. JOIN UNPAIRED,ONLY. Specify a REFORMAT statement with the match-marker (?) something like this =(F1:1.80,F2:1,80,?)

Then you can test which unmatched record you got, to source the data for a BUILD statement,
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post