On Fri, 6 Apr 2018 13:13:45 -0500, John McKown wrote:

>On Fri, Apr 6, 2018 at 12:50 PM, Frank Swarbrick <
>frank.swarbr...@outlook.com> wrote:
>
>> Is there some way I could specify a DD concatenation where the system
>> would search the DD's in order until it found a named member?
>>
>
>//COPYMEM EXEC PGM=IEBCOPY
>//SYSPRINT DD SYSOUT=*
>//SYSIN DD *
> COPY I=INDD,O=OUTDD
> S M=MEMBER
>/*
>//INDD DD DISP=SHR,DSN=dsn1
>//     DD DISP=SHR,DSN=dsn2
>//OUTDD DD DSN=&&amp;TEMPDS,DISP=(NEW,PASS),
>// LIKE=dsn1,SPACE=(CYL,(10,10,100))
>//*
>//MYSTEP EXEC PGM=MYPGM
>//MYDD DD DISP=SHR,DSN=&&amp;TEMPDS(member)
>​//* OTHER PARTS OF THE JOB

I like this solution, but the doc for IEBCOPY says that the input data sets 
cannot 
be concatenated. So you could do something like this:

//E1 EXPORT SYMLIST=MEMBER
//S1 SET MEMBER=ABC
...
//COPYMEM EXEC PGM=IEBCOPY
//SYSPRINT DD SYSOUT=*
//SYSIN DD *,SYMBOLS=JCLONLY
 COPY I=INDD2,O=OUTDD
 S M=&MEMBER
 COPY I=INDD1,O=OUTDD
 S M=(&MEMBER,,R)
/*
//INDD1 DD DISP=SHR,DSN=dsn1
//INDD2 DD DISP=SHR,DSN=dsn2
//OUTDD DD DSN=&&amp;TEMPDS,DISP=(NEW,PASS),
// LIKE=dsn1,SPACE=(TRK,(10,10,1))
//*
//MYSTEP EXEC PGM=MYPGM
//MYDD DD DISP=SHR,DSN=&&amp;TEMPDS(&MEMBER)
​//* OTHER PARTS OF THE JOB

The COPY statements copy the member in reverse order, from the bottom of the 
logical concatenation to the top, specifying REPLACE. Also, you can use symbols 
in the IEBCOPY SYSIN, provided you are at the right level. I think that's z/OS 
2.1.

-- 
Tom Marchant

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to