data set A (LRECL):
12345AAA
12445DDD
32445BBB
67888CCC
12445DDD
32445BBB
67888CCC
data set B:
12345
67888
67888
If the 1st 5 positions from data set A are in data set B then I want to add an indicator to the end of the record in data set A, like so:
data set A:
12345AAAY
12445DDD
32445BBB
67888CCCY
12445DDD
32445BBB
67888CCCY
I've looked at several examples and methods but it is still not working properly.
//STEP40 EXEC SORTD,CYLS=1000
//SYSOUT DD SYSOUT=*
//SORTJNF1 DD DSN=data set A,
// DISP=(OLD,CATLG,KEEP)
//SORTJNF2 DD DSN=data set B,
// DISP=(OLD,CATLG,KEEP)
//OUTFILE DD DSN=data set C,
// DISP=(NEW,CATLG,KEEP),
// DCB=(DSORG=PS,RECFM=FB,LRECL=9,BLKSIZE=0),
// SPACE=(CYL,(1000,1000),RLSE),
// UNIT=DISK
//SYSIN DD *
JOINKEYS FILES=F1,FIELDS=(1,5,A),SORTED,NOSEQCK
JOINKEYS FILES=F2,FIELDS=(1,5,A),SORTED,NOSEQCK
JOIN UNPAIRED,F1
REFORMAT FIELDS=(F1:1,9,?)
OPTION COPY
OUTFILE IFTHEN=(WHEN=(9,1,CH,EQ,C'B'),OVERLAY=(9:C'Y'))
/*
//SYSOUT DD SYSOUT=*
//SORTJNF1 DD DSN=data set A,
// DISP=(OLD,CATLG,KEEP)
//SORTJNF2 DD DSN=data set B,
// DISP=(OLD,CATLG,KEEP)
//OUTFILE DD DSN=data set C,
// DISP=(NEW,CATLG,KEEP),
// DCB=(DSORG=PS,RECFM=FB,LRECL=9,BLKSIZE=0),
// SPACE=(CYL,(1000,1000),RLSE),
// UNIT=DISK
//SYSIN DD *
JOINKEYS FILES=F1,FIELDS=(1,5,A),SORTED,NOSEQCK
JOINKEYS FILES=F2,FIELDS=(1,5,A),SORTED,NOSEQCK
JOIN UNPAIRED,F1
REFORMAT FIELDS=(F1:1,9,?)
OPTION COPY
OUTFILE IFTHEN=(WHEN=(9,1,CH,EQ,C'B'),OVERLAY=(9:C'Y'))
/*
Do I have to send my output to data set C or can I just append to end of data set A?
When I originally create data set A in STEP20, do I need to add a position on to the end? Do I need to make it 9?
If anyone can help, I would greatly appreciate it.
Thx in advance.