Introduction


IEBCOPY is a dataset utility used to copy or merge members between one or more PDS or PDSEs. The copying can be full or partial. It creates a PDS backup and copies the members back from the backup into a PDS.

It automatically lists the number of unused directory blocks. Also, it lists the number of unused tracks available for members of the output PDS.

IEBCOPY input or output for COPY operation can be a PDS, a PDSE, or an unloaded PS that contains members. IEBCOPY output for COPY operation is either a new or old dataset.

Syntax -

----+----1----+----2----+----3----+----4----+----5----+
//JOBCARD
//*
//STEP1    EXEC PGM=IEBCOPY
//SYSPRINT DD SYSOUT=*
//SYSOUT   DD SYSOUT=*
//SYSDUMP  DD SYSOUT=* 
//SYSUT1   DD DSN=...
//SYSUT2   DD DSN=...
//SYSUT3   DD UNIT=..
//SYSUT4   DD UNIT=..
//SYSIN    DD *
   control-statements
/*

IEBCOPY processes the tasks using job and utility control statements. Those are -

  • Job Control Statements
  • Utility Control Statements

Job Control Statements


  • SYSPRINT - Optional. It uses for system output messages.
  • SYSUT01 | any-ddname - Mandatory. This is an input PDS or unloaded PS file. Multiple DD statements can be coded as input.
  • SYSUT02 | any-ddname - Mandatory. This is an output PDS or unloads the dataset for output.
  • SYSUT03 | SYSUT04 - Optional. These are temporary datasets used to provide the additional memory for processing the task.
  • SYSOUT - Optional. System-defined DDname used for displaying output information related to the job.
  • SYSDUMP - Optional. System uses it for dumping when an abend occurs.
  • SYSIN - Contains the control statements that are required for IEBCOPY utility.

Performing Tasks -


IEBCOPY to perform the following tasks –

Utility Control Statements


IEBCOPY utility control statements are used to control the utility processing and those are -

Note! A copy operation starts with a COPY, COPYGRP, COPYGROUP, COPYMOD, or ALTERMOD statement. It continues until another COPY, COPYGRP, COPYGROUP, COPYMOD, or ALTERMOD statement is found or the end of the control dataset is found.

Return Codes -


IEBCOPY returns a code in register 15 to specify the results of the utility execution status. The return codes of IEBCOPY and their meanings are -

Codes Meaning
00 (X'00') Successful completion.
04 (X'04') One or more COPY or COPYGRP operations completed unsuccessfully or uncompleted.
Recovery may be possible for this case.
08 (X'08') An unrecoverable error exists. The utility ends.