Comparing two files



Compuware's data management products: File-AID for IMS, File-AID/MVS, File-AID for DB2 and DBA-XPERT for DB2

Comparing two files

Postby karla76 » Mon Jan 12, 2015 12:31 pm

Hi,

I have two files that need to be compared based on a field.

first file : is of record length 90 and the field to be compared is from column pos 1-9. This field is duplicated.
Second file: is of record length 150 and the field to be compared is from column pos 1-9. This field is not duplicated.

If the field in first file is present in the second file then we need to write the record from first file to third file along with a filed from the second file present in col pos 140-150.
If it is not present then we need to have it as spaces.

Please guide me with a solution.
karla76
 
Posts: 1
Joined: Mon Jan 12, 2015 12:22 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Comparing two files

Postby yo264376 » Mon Feb 09, 2015 3:30 pm

Hi,

You need to first run a step to remove duplicate records from your first file. Code is

//Sysin dd*
sort fields=(1,9,CH,A)
sum fields=none
/*

Then you have to use JOINKEYS in your sysin card as below:
JOINKEYS F1=FILEA,FIELDS=(1,9,A)
JOINKEYS F2=FILEB,FIELDS=(1,9,A)
REFORMAT FIELDS=(F1:1,90,F2:140,11)
SORT FIELDS=COPY

Hope this will help.
-Yogesh
yo264376
 
Posts: 1
Joined: Fri Mar 07, 2014 12:18 pm
Has thanked: 0 time
Been thanked: 0 time


Return to File-AID

 


  • Related topics
    Replies
    Views
    Last post