I am trying to match two files IP1 and IP2 and write the matched records in a file OP1 and the records which are there in IP1 and does not have match in IP2 to OP2,and the records which are there in IP2 and does not have match in IP1 to OP3.
I found the example sort card which is shown below from a material released by IBM
//JKE5 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTJNF1 DD *
CARRIE F101
DAVID F102
FRANK F103
HOLLY F104
VICKY F105
//SORTJNF2 DD *
NO CARRIE F201
YES HOLLY F202
YES KAREN F203
NO SRI HARI F204
YES VICKY F205
//F1ONLY DD SYSOUT=*
//F2ONLY DD SYSOUT=*
//BOTH DD SYSOUT=*
//SYSIN DD *
* Control statements for JOINKEYS application
JOINKEYS FILE=F1,FIELDS=(1,10,A),SORTED,NOSEQCK
JOINKEYS FILE=F2,FIELDS=(7,10,A),SORTED,NOSEQCK
JOIN UNPAIRED,F1,F2
REFORMAT FIELDS=(F1:1,14,F2:1,20,?)
* Control statements for main task (joined records)
OPTION COPY
OUTFIL FNAMES=F1ONLY,INCLUDE=(35,1,CH,EQ,C'1'),
BUILD=(1,14)
OUTFIL FNAMES=F2ONLY,INCLUDE=(35,1,CH,EQ,C'2'),
BUILD=(15,20)
OUTFIL FNAMES=BOTH,INCLUDE=(35,1,CH,EQ,C'B'),BUILD=(1,14,/,15,20)
/*
//SYSOUT DD SYSOUT=*
//SORTJNF1 DD *
CARRIE F101
DAVID F102
FRANK F103
HOLLY F104
VICKY F105
//SORTJNF2 DD *
NO CARRIE F201
YES HOLLY F202
YES KAREN F203
NO SRI HARI F204
YES VICKY F205
//F1ONLY DD SYSOUT=*
//F2ONLY DD SYSOUT=*
//BOTH DD SYSOUT=*
//SYSIN DD *
* Control statements for JOINKEYS application
JOINKEYS FILE=F1,FIELDS=(1,10,A),SORTED,NOSEQCK
JOINKEYS FILE=F2,FIELDS=(7,10,A),SORTED,NOSEQCK
JOIN UNPAIRED,F1,F2
REFORMAT FIELDS=(F1:1,14,F2:1,20,?)
* Control statements for main task (joined records)
OPTION COPY
OUTFIL FNAMES=F1ONLY,INCLUDE=(35,1,CH,EQ,C'1'),
BUILD=(1,14)
OUTFIL FNAMES=F2ONLY,INCLUDE=(35,1,CH,EQ,C'2'),
BUILD=(15,20)
OUTFIL FNAMES=BOTH,INCLUDE=(35,1,CH,EQ,C'B'),BUILD=(1,14,/,15,20)
/*
When I executed this, I am getting the below error message
SYSIN :
JOINKEYS FILE=F1,FIELDS=(1,10,A),SORTED,NOSEQCK
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> *
JOINKEYS FILE=F2,FIELDS=(7,10,A),SORTED,NOSEQCK
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> *
JOIN UNPAIRED,F1,F2
REFORMAT FIELDS=(F1:1,14,F2:1,20,?)
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>*
OPTION COPY
OUTFIL FNAMES=F1ONLY,INCLUDE=(35,1,CH,EQ,C'1'),
BUILD=(1,14)
OUTFIL FNAMES=F2ONLY,INCLUDE=(35,1,CH,EQ,C'2'),
BUILD=(15,20)
OUTFIL FNAMES=BOTH,INCLUDE=(35,1,CH,EQ,C'B'),
BUILD=(1,14,/,15,20)
WER268A JOINKEYS STATEMENT: SYNTAX ERROR
WER268A JOINKEYS STATEMENT: SYNTAX ERROR
WER268A REFORMAT STATEMENT: SYNTAX ERROR
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE
JOINKEYS FILE=F1,FIELDS=(1,10,A),SORTED,NOSEQCK
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> *
JOINKEYS FILE=F2,FIELDS=(7,10,A),SORTED,NOSEQCK
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> *
JOIN UNPAIRED,F1,F2
REFORMAT FIELDS=(F1:1,14,F2:1,20,?)
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>*
OPTION COPY
OUTFIL FNAMES=F1ONLY,INCLUDE=(35,1,CH,EQ,C'1'),
BUILD=(1,14)
OUTFIL FNAMES=F2ONLY,INCLUDE=(35,1,CH,EQ,C'2'),
BUILD=(15,20)
OUTFIL FNAMES=BOTH,INCLUDE=(35,1,CH,EQ,C'B'),
BUILD=(1,14,/,15,20)
WER268A JOINKEYS STATEMENT: SYNTAX ERROR
WER268A JOINKEYS STATEMENT: SYNTAX ERROR
WER268A REFORMAT STATEMENT: SYNTAX ERROR
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE
Code'd and rainbow-colours and odd formatting removed