Wednesday, June 18, 2014

JOB Utilities IEBCOPY


IEBCOPY (Library Copy) 

IEBCOPY is a data set utility that is used to copy or merge members between one or more partitioned data sets, or partitioned data sets extended (PDSEs), in full or in part.

  • Make a copy of a partitioned data set or PDSE.
  • Merge partitioned data sets (except when unloading).
  • Create a sequential form of a partitioned data set or PDSE for a backup or transport.
  • Reload one or more members from a PDSU into a partitioned data set or PDSE. (Note that an unloaded load module cannot be converted to a program object in this process.)
  • Select specific members of a partitioned data set or PDSE to be copied, loaded, or unloaded.
  • Replace members of a partitioned data set or PDSE.
  • Rename selected members of a partitioned data set or PDSE when copied.
  • Exclude members from a data set to be copied, unloaded, or loaded. (Except on COPYGRP).
  • Compress a partitioned data set in place.
  • Upgrade a load module for faster loading by MVS program fetch.
  • Copy and reblock load modules.
  • Convert load modules in a partitioned data set to program objects in a PDSE when copying a partitioned data set to a PDSE.
  • Convert a partitioned data set to a PDSE or a PDSE to a partitioned data set.
  • Copy to or from a PDSE data set, a member and its aliases together as a group (COPYGRP).
  • In addition, IEBCOPY automatically lists the number of unused directory blocks and the number of unused tracks that are available for member records if the output data set is a partitioned data set.



IEBCOPY uses the following input:
A partitioned data set, or a PDSE, or unload data set that contains members to be copied, merged, altered, reblocked, loaded, or unloaded.
An optional control data set that contains utility control statements. The control data set is required when:There is more than one input or one output data set to be processed,Designated members are to be selected or excluded, or
A load module library is to be altered or reblocked (ALTERMOD or COPYMOD is needed).

IEBCOPY produces the following output:
Output data sets, which contain the copied, merged, altered, reblocked, or unloaded members. The output data set is either a new data set (from a copy, reblock, load, or unload) or an old data set (from a merge, compress-in-place, copy, alter, or load).
A message data set, which lists control statements, IEBCOPY activities, and error messages, as applicable.

IEBCOPY might require:

Optional spill data sets, which are temporary data sets used to provide space when not enough virtual storage is available for the input or output partitioned data set directories. These data sets are opened only when needed.
If IEBCOPY is invoked from an application program, you can dynamically allocate the data sets by issuing SVC 99 before calling IEBCOPY.


Statement Use
Major Statements
ALTERMOD Indicates the beginning of an alter-in-place operation for load modules.
COPY Indicates the beginning of a COPY operation.
COPYGRP Indicates the beginning of a COPYGRP operation.
COPYMOD Indicates the beginning of a copy and load module reblock operation.
INDD= Indicates the beginning of another copy step.
Minor Statements
EXCLUDE Specifies members in the input data set to be excluded from the copy step.
SELECT Specifies which members in the input data set are to be copied.

Tip: Giving LRECL a value that is 1-byte less than the width of your TSO terminal will allow you to view entire records from a listing without scrolling left or right.


Example 1: Copy an Entire Data Set

  //COPY     JOB   ...
  //JOBSTEP  EXEC  PGM=IEBCOPY
  //SYSPRINT DD  SYSOUT=A
  //SYSUT1   DD  DSNAME=DATASET5,UNIT=disk,VOL=SER=111113,
  //             DISP=SHR
  //SYSUT2   DD  DSNAME=DATASET4,UNIT=disk,VOL=SER=111112,
  //             DISP=(NEW,KEEP),SPACE=(TRK,(5,1,2))


Example 2: Merge Four Data Sets

//COPY     JOB   ...
  //JOBSTEP  EXEC  PGM=IEBCOPY
  //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
  /*

Example 3: Copy and Replace Selected Members of a Data Set

  //COPY     JOB     ...
  //JOBSTEP  EXEC  PGM=IEBCOPY
  //SYSPRINT DD  SYSOUT=A
  //OUT1     DD  DSNAME=DATASET1,UNIT=disk,VOL=SER=111112,
  //             DISP=(OLD,KEEP)
  //IN6      DD  DSNAME=DATASET6,UNIT=disk,VOL=SER=111115,
  //             DISP=OLD
  //IN5      DD  DSNAME=DATASET5,UNIT=disk,VOL=SER=111116,
  //             DISP=(OLD,KEEP)
  //SYSUT3   DD  UNIT=SYSDA,SPACE=(TRK,(1))
  //SYSUT4   DD  UNIT=SYSDA,SPACE=(TRK,(1))
  //SYSIN    DD  *
  COPYOPER   COPY    OUTDD=OUT1
                     INDD=IN5,IN6
             SELECT  MEMBER=((B,,R),A)
  /*

Example 4: Compress a PDS

//JS10    EXEC PGM=IEBCOPY,REGION=1M
//SYSPRINT  DD SYSOUT=*
//I1        DD DSN=MUK001A.OFFSHORE.JCL,DISP=OLD
//O1        DD DSN=MUK001A.OFFSHORE.JCL,DISP=OLD
//SYSIN     DD *

 COMP1 C O=O1,I=((I1,R))

Example 5: Replace a Load Module Using COPYMOD

  //STEP1    EXEC PGM=IEBCOPY
  //REPLACE  JOB  ...
  //SYSPRINT DD  SYSOUT=A
  //TESTLIB  DD  DSN=MUKESH.COBOL.TESTLOAD,DISP=SHR,UNIT=3390,
  //             VOL=SER=TEST01,DCB=(BLKSIZE=23470)
  //PRODLIB  DD  DSN=EMPL.MASTER.LOADLIB,DISP=(OLD,KEEP)
  //             UNIT=3380,VOL=SER=PROD01,DCB=(BLKSIZE=19069)
  //SYSIN    DD  *
             COPYMOD OUTDD=PRODLIB,INDD=TESTLIB
             SELECT MEMBER=((WAGETAX,,R))
  /*

Example 6: Alter Load Modules in Place

//ALTERONE JOB  ...
  //STEPA    EXEC PGM=IEBCOPY
  //SYSPRINT DD  SYSOUT=A
  //SYSUT3   DD  UNIT=SYSDA,SPACE=(TRK,(5,1))
  //LIBJ     DD  DSNAME=MODLIBJ,DISP=(OLD,KEEP)
  //LIBK     DD  DSNAME=MODLIBK,DISP=(OLD,KEEP)
  //LIBL     DD  DSNAME=MODLIBL,DISP=(OLD,KEEP)
  //SYSIN    DD  *
       ALTERMOD  OUTDD=LIBJ
       ALTERMOD  OUTDD=LIBK,LIST=NO
       SELECT    MEMBER=(MODX,MODY,MODZ)
       ALTERMOD  OUTDD=LIBL
       EXCLUDE   MEMBER=(MYMACRO,MYJCL)
  /*

No comments:

Post a Comment