SELECT
SELECT
Summary
For basic information, go through the IEBCOPY Utility (for Beginners)
- The SELECT statement is used to select the specific members for a copy from input to output datasets.
- The SELECT statement specifies selected members to be altered, copied, loaded, or unloaded to an output data set.
- A SELECT statement cannot appear with an EXCLUDE statement in the same copy, unload, or load step.
Syntax -
//SYSIN DD *
[label] SELECT MEMBER=({name1|
(name1,newname1[,R])|
(name1,,R)}
[,{name2|
(name2,newname2[,R])|
(name2,,R)}][,...])
/*
- MEMBER=[(]name1[,...][)] - Specifies members on the input data set that should include while copying, unloading, or loading to the output data set.
- R - Specifies that the members to be copied or loaded from the input data set will replace any identically named members on the output PDS.
- newname1,... - newname1 specifies the new name of the name1 and newname2 specifies the new name of name2 and so on.
Practical Example -
Scenario - Copying member (COPY) from one PDS to another.
JCL -
----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
***************************** Top of Data ******************************
//MATEPKS JOB (123),'MTH',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),
// NOTIFY=&SYSUID
//***************************************************
//* SELECING MEMBER FROM INPUT PDS DURING COPY
//***************************************************
//STEP10 EXEC PGM=IEBCOPY
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSDUMP DD SYSOUT=*
//SYSUT1 DD DSN=MATEPK.IEBCOPY.INPPDS,DISP=SHR
//SYSUT2 DD DSN=MATEPK.IEBCOPY.OUTPDS,DISP=OLD
//SYSIN DD *
COPY INDD=SYSUT1,OUTDD=SYSUT2
SELECT MEMBER=FIRSTPRG
/*
**************************** Bottom of Data ****************************
Job Status -

Output -

Explaining Example -
- SYSUT1 DD DSN=MATEPK.IEBCOPY.INPPDS - Specifies the input PDS.
- SYSUT2 DD DSN=MATEPK.IEBCOPY.OUTPDS - Specifies the output PDS.
- COPYGRP INDD=SYSUT1,OUTDD=SYSUT2 - Copies members from SYSUT1 to SYSUT2.
- SELECT MEMBER=FIRSTPRG - Copies member FIRSTPRG from SYSUT1 to SYSUT2.