You are correct that the input data sets cannot be concatenated, but I might 
give an update to the solution in that you can specify multiple input DD's on 
the copy statement.
From the examples for merging 4 data sets into one single one, but with an 
addition of the select statement:
  //SYSPRINT DD  SYSOUT=A
  //IN1      DD  DSNAME=DATASET1,UNIT=disk,VOL=SER=111112,
  //             DISP=SHR
  //IN5      DD  DSNAME=DATASET5,UNIT=disk,VOL=SER=111114,
  //             DISP=OLD
  //OUT2     DD  DSNAME=DATASET2,UNIT=disk,VOL=SER=111115,
  //             DISP=(OLD,KEEP)
  //IN6      DD  DSNAME=DATASET6,UNIT=disk,VOL=SER=111117,
  //             DISP=(OLD,DELETE)
  //SYSUT3   DD  UNIT=SYSDA,SPACE=(TRK,(1))
  //SYSIN    DD  *
  COPYOPER   COPY  OUTDD=OUT2
                   INDD=IN1
                   INDD=IN6
                   INDD=IN5
  SELECT MEMBER=(ABC)
  /*

This way the first data set that the member is found it is used and no error 
will be generated.

Also the COPY statement will support use of "INDD=(IN1,IN6,IN5)" it just 
depends on your taste in formatting.

Al Nims
Systems Admin/Programmer 3
UFIT
Universtiy of Florida
(352) 273-1298

-----Original Message-----
From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On Behalf 
Of Tom Marchant
Sent: Friday, April 06, 2018 5:06 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: Finding a member in a DD concatenation

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

----------------------------------------------------------------------
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