I would like to splice them into 1 output file. There are no dupes, and there is a key in all 3 files. I would like to keep all records in the base file.
//IN1 DD *
2432 REE
2433 REE
2434 REF
2436 REJ
2437 RRE
2477 RER
//IN2 DD *
2432 MG
2437 MG
//IN3 DD *
2437 CD
2477 CD
2432 REE
2433 REE
2434 REF
2436 REJ
2437 RRE
2477 RER
//IN2 DD *
2432 MG
2437 MG
//IN3 DD *
2437 CD
2477 CD
I would like to get results like this:
2432 REE MG
2433 REE
2434 REF
2436 REJ
2437 RRE MG CD
2477 RER CD
2433 REE
2434 REF
2436 REJ
2437 RRE MG CD
2477 RER CD
I can get close with following:
COPY FROM(IN1) TO(TEMP1) USING(CTL1)
COPY FROM(IN2) TO(TEMP1) USING(CTL2)
COPY FROM(IN3) TO(TEMP1) USING(CTL3)
SPLICE FROM(TEMP1) TO(OUTFILE) -
ON(1,4,CH) WITHEACH KEEPNODUPS WITH(18,2) -
WITH(24,2) USING(CTL4)
//CTL1CNTL DD *
OUTREC FIELDS=(1,12,25:X)
//CTL2CNTL DD *
OUTREC FIELDS=(1,4,18:11,2,25:X)
//CTL3CNTL DD *
OUTREC FIELDS=(1,4,24:11,2)
COPY FROM(IN2) TO(TEMP1) USING(CTL2)
COPY FROM(IN3) TO(TEMP1) USING(CTL3)
SPLICE FROM(TEMP1) TO(OUTFILE) -
ON(1,4,CH) WITHEACH KEEPNODUPS WITH(18,2) -
WITH(24,2) USING(CTL4)
//CTL1CNTL DD *
OUTREC FIELDS=(1,12,25:X)
//CTL2CNTL DD *
OUTREC FIELDS=(1,4,18:11,2,25:X)
//CTL3CNTL DD *
OUTREC FIELDS=(1,4,24:11,2)
However, it drops the value CD from IN3 for the 2477 record. giving me:
2432 REE MG
2433 REE
2434 REF
2436 REJ
2437 RRE MG CD
2477 RER
2433 REE
2434 REF
2436 REJ
2437 RRE MG CD
2477 RER
Hope that makes sense...any help would be appreciated. Thanks!