I have two files of LRECL 100 each.
I want to match the two files record-wise.
My intention is to write a record to the output file (from the first i/p file) if there is any change in the 10th character of the two i/p files.
Basically I'm matching 1st record of i/p file-1 to 1st record of i/p file-2 and if a change happens in 10th character, record from i/p file-1 will be written to o/p.
raak,
The best way to do this one is using 'JOIN' function of SYNCSORT.Please check the SYNCSORT version of your shop and let us know.
Please also provide the sample input and the expected output.
there is one problem with this card.. It will take only those records which has a 'Y' in the 10th position from file-1 and 'N' in the 10th position from file-2.
here the problem is that my record sequence in both files might get corrupted..for eg:
File 1
123456789Y
012345678N
901234567Y
File 2
123456789N
012345678N
901234567N
in this case, only the first 2 records from the input file-1 will be included and 3 records from file-2 will be included - as per the INCLUDE condition in the cards.
So effectively the 3rd record from input file-1 will be matched against 2nd record from file-2.
Is this happening the same way I described or am I getting wrong somewhere???
did you try the JOINKEYs. What was the output you were getting. Please let us know.
Below is the description of what the Sort is doing.
File-1
123456789Y
012345678N
901234567Y
File-2
123456789N
012345678N
901234567N
Selection from File-1
123456789Y00000001
901234567Y00000003
Selection from File-2
123456789N00000001
012345678N00000002
901234567N00000003
The JOINKEYS are on SEQNUM,hence,
123456789Y00000001 of File-1 will match against 123456789N00000001 of File-2
901234567Y00000003 of File-1 will match against 901234567N00000003 of File-2