Hi Forum,
I am a newbie here but not to MF. I keep coming here for suggestions and tricks. But this is my first post.
I have a unique usecase where I have to prepare the SYSIN card for an IEBCOPY job. I create two temp files - one for the 'copy operation statement' and the other one for the 'select member' statements. Below are the steps.
//STEP010 EXEC PGM=SORT
//SORTIN DD *
COPYGRP INDD=IN0007,OUTDD=OUT0007
//SORTOUT DD DISP=(,PASS),DSN=&&CPYSTMT
//SYSOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
//*
//STEP020 EXEC PGM=SORT
//SORTIN DD DISP=SHR,DSN=XXX.XXX.XXX
//OXXX DD DISP=(,PASS),DSN=&&CPYLST
//SYSIN DD *
OPTION COPY
OUTFIL FNAMES=OXXX,
INCLUDE=(15,4,CH,EQ,C'XXXX'),
OUTREC=(1:5X,6:C'S M=((YYYY,',17:1,8,25:C'))',27:54X)
I have to merge these two files to prepare the sysin file that should look like below
COPYGRP INDD=IN0007,OUTDD=OUT0007
S M=((YYYY,AAAAAA))
COPYGRP INDD=IN0007,OUTDD=OUT0007
S M=((YYYY,BBBBBB))
I do not know how to achieve this as the first file has only one record and second file has multiple(it will vary) records. I know how to merge records using SEQNUM technique but that'll give a useful output only if the first file has equal no of records as that of the second one. And simple merge won't help either.
Can someone help please?
Side note : For a specific reason I have to copy the content of YYYY member from one dataset to another and rename it to a valid member name. IEBCOPY says that there should be an operation for every copy & rename and that's the reason I need the COPYGRP operation for all members.
Apologies if it seems to be a naïve ask.