I am using below given SORT card to get output data.
//SYSIN DD *
JOINKEYS FILES=F1,FIELDS=(21,8,A)
JOINKEYS FILES=F2,FIELDS=(17,8,A)
JOIN UNPAIRED,F1,F2
REFORMAT FIELDS=(F1:1,28,F2:17,45)
SORT FIELDS=(1,8,CH,A)
INCLUDE COND=(29,1,CH,EQ,C' ',OR,21,8,CH,EQ,29,8,CH)
OUTFIL IFTHEN=(WHEN=(29,1,CH,EQ,C' '),
BUILD=(1,8,C':',21,8,C':',C'### OMITTED ###',40:C':',
C'### OMITTED ### ')),
IFTHEN=(WHEN=(21,8,CH,EQ,29,8,CH),
BUILD=(1,8,C':',29,8,C':',37,21,C':',58,16))
//
JOINKEYS FILES=F1,FIELDS=(21,8,A)
JOINKEYS FILES=F2,FIELDS=(17,8,A)
JOIN UNPAIRED,F1,F2
REFORMAT FIELDS=(F1:1,28,F2:17,45)
SORT FIELDS=(1,8,CH,A)
INCLUDE COND=(29,1,CH,EQ,C' ',OR,21,8,CH,EQ,29,8,CH)
OUTFIL IFTHEN=(WHEN=(29,1,CH,EQ,C' '),
BUILD=(1,8,C':',21,8,C':',C'### OMITTED ###',40:C':',
C'### OMITTED ### ')),
IFTHEN=(WHEN=(21,8,CH,EQ,29,8,CH),
BUILD=(1,8,C':',29,8,C':',37,21,C':',58,16))
//
Whether I use OUTFIL or OUTREC, I get the same results. Can you please help me in understanding the exact difference?
Thanks.