//STEP1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTJNF1 DD DSN=INFILE1,DISP=PASS
//SORTJNF2 DD DSN=INFILE2,DISP=PASS
//SORTOUT01 DD DSN=MATCHED,DISP=(NEW,CATLG,DELETE)
//SORTOUT02 DD DSN=UNPAIREDFRMF1,DISP=(NEW,CATLG,DELETE)
//SORTOUT03 DD DSN=UNPAIREDFRMF2,DISP=(NEW,CATLG,DELETE)
//SORT01CNTL DD *
JOINKEYS FILE=F1,FIELDS=(1,4,CH,A)
JOINKEYS FILE=F2,FIELDS=(5,4,CH,A)
JOIN PAIRED,ONLY
/*
//SORT02CNTL DD *
JOINKEYS FILE=F1,FIELDS=(1,4,CH,A)
JOINKEYS FILE=F2,FIELDS=(5,4,CH,A)
JOIN UNPAIRED,F1,ONLY
/*
//SORT03CNTL DD *
JOINKEYS FILE=F1,FIELDS=(1,4,CH,A)
JOINKEYS FILE=F2,FIELDS=(5,4,CH,A)
JOIN UNPAIRED,F2,ONLY
/*
//
//SYSOUT DD SYSOUT=*
//SORTJNF1 DD DSN=INFILE1,DISP=PASS
//SORTJNF2 DD DSN=INFILE2,DISP=PASS
//SORTOUT01 DD DSN=MATCHED,DISP=(NEW,CATLG,DELETE)
//SORTOUT02 DD DSN=UNPAIREDFRMF1,DISP=(NEW,CATLG,DELETE)
//SORTOUT03 DD DSN=UNPAIREDFRMF2,DISP=(NEW,CATLG,DELETE)
//SORT01CNTL DD *
JOINKEYS FILE=F1,FIELDS=(1,4,CH,A)
JOINKEYS FILE=F2,FIELDS=(5,4,CH,A)
JOIN PAIRED,ONLY
/*
//SORT02CNTL DD *
JOINKEYS FILE=F1,FIELDS=(1,4,CH,A)
JOINKEYS FILE=F2,FIELDS=(5,4,CH,A)
JOIN UNPAIRED,F1,ONLY
/*
//SORT03CNTL DD *
JOINKEYS FILE=F1,FIELDS=(1,4,CH,A)
JOINKEYS FILE=F2,FIELDS=(5,4,CH,A)
JOIN UNPAIRED,F2,ONLY
/*
//
I dont have mainframe access so can any one check it and correct me pls?