I have two input files, each with length of 5200 bytes. A seven byte key is used to compare both files, if there is a match then it needs to be written to "match" file but while writing to match file I need a few fields from infile1
and all other fields from infile2
.
If there is no match then write to no match
file.
Is it possible to do it in sort
? I know it can be easily done using COBOL program but just want to know in SORT/ICETOOL/Easytrieve Plus (EZTPA00)
.
Though its really long back this question was posted, I wish to answer as it might help others. This can be done easily by means of
JOINKEYS
in a SINGLE step. Here goes the pseudo code:JOINKEYS PAIRED(implicit)
and get both the records via reformatting filed. If there is NO match from either of files then append/prefix some special character say'$'
'$'
, if exists then it doesnt have a paired record, it'll be written into unpaired file and rest to paired file.Please do get back incase of any questions.