i am new to the forum. i appolozise if i posted a previously asked question or in wrong forum.
i have 2 input files . according to the requiremnt i need only those records present in both files matching on col <5-9> and having col <11-15> as "xxxxx" and col<19-20> as "ee" in file 1 and col<19-20> as "ee" in file 2.
file IN1:
----+----1----+----2----+----3
111 AAAAA XXXXX EE
111 BBBBB YYYYY TT
111 CCCCC XXXXX EE
111 DDDDD XXXXX EE
111 EEEEE ZZZZZ RR
111 AAAAA XXXXX EE
111 BBBBB YYYYY TT
111 CCCCC XXXXX EE
111 DDDDD XXXXX EE
111 EEEEE ZZZZZ RR
file IN2:
----+----1----+----2----+----3
111 AAAAA 11111 EE
111 BBBBB 22222 TT
111 SSSSS 33333 EE
111 CCCCC 44444 EE
111 FFFFF 55555 RR
111 AAAAA 11111 EE
111 BBBBB 22222 TT
111 SSSSS 33333 EE
111 CCCCC 44444 EE
111 FFFFF 55555 RR
file OUT1: matched record
----+----1----+----2----+----3
111 AAAAA 11111 EEA
111 CCCCC 44444 EEA
111 AAAAA 11111 EEA
111 CCCCC 44444 EEA
file OUT2: unmatched from file 1
----+----1----+----2----+----3
111 DDDDD XXXXX EE
111 DDDDD XXXXX EE
below is the icetool jcl i have written to serve the above purpose.
//TOOLIN DD *
COPY FROM(IN1) TO(OUT1) USING(CTL1)
/*
//CTL1CNTL DD *
JOINKEYS F1=IN1,FIELDS=(5,5,A),
INCLUDE=(19,2,CH,EQ,C'EA',AND,11,5,CH,EQ,C'xxxxx')
JOINKEYS F2=IN2,FIELDS=(5,5,A),
INCLUDE=(19,2,CH,EQ,C'EA')
REFORMAT FIELDS=(F1:1,10,F2:11,10)
OUTREC BUILD=(1,20,X'C1')
/*
COPY FROM(IN1) TO(OUT1) USING(CTL1)
/*
//CTL1CNTL DD *
JOINKEYS F1=IN1,FIELDS=(5,5,A),
INCLUDE=(19,2,CH,EQ,C'EA',AND,11,5,CH,EQ,C'xxxxx')
JOINKEYS F2=IN2,FIELDS=(5,5,A),
INCLUDE=(19,2,CH,EQ,C'EA')
REFORMAT FIELDS=(F1:1,10,F2:11,10)
OUTREC BUILD=(1,20,X'C1')
/*
now my new requirement is to get the unmached records from file 1 which has col <11-15> as "xxxxx" and col<19-20> as "ee" in a different output file.
is there any way to modify the jcl to get the unmatched records as well?