SELECT Example


Scenario - Copying member (COPY) from one PDS to another.

JCL -

----+----1----+----2----+----3----+----4----+----5----+
//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
/*

Job Status -

SELECT Job Status

Output -

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