Copying & Reblocking Load Modules


The COPYMOD statement performs copying and reblocks the load modules to the appropriate block size for the target device. The block size of the output PDS is increased by COPYMOD as required to match the MAXBLK value. The maximum block size used by the COPYMOD function is 32760 bytes.

Practical Example -


Scenario - Copying load modules from one PDS to another PDS with different block size.

JCL -

----+----1----+----2----+----3----+----4----+----5----+
//MATEPKI  JOB (123),'MTH',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),
//             NOTIFY=&SYSUID
//*******************************************************************
//* COPY LOAD MODULE FROM ONE PDS TO ANOTHER PDS OF DIFFERENT BLOCK 
//*******************************************************************
//STEP10   EXEC PGM=IEBCOPY
//SYSPRINT DD SYSOUT=*
//SYSOUT   DD SYSOUT=*
//SYSDUMP  DD SYSOUT=*
//SYSUT1   DD DSN=MATEPK.IEBCOPY.INPLOAD,DISP=SHR
//SYSUT2   DD DSN=MATEPK.IEBCOPY.OUTLOAD,
//            DISP=(NEW,CATLG,DELETE),
//            SPACE=(TRK,(10,10,10),RLSE),
//            UNIT=3390,VOL=SER=DEVHD4,
//            DCB=(DSORG=PO,RECFM=U,LRECL=0,BLKSIZE=23470)
//SYSIN    DD *
    COPYMOD OUTDD=SYSUT2,INDD=SYSUT1,MAXBLK=13030
/*

Job Status -

COPYMOD Job Status

Output -

COPYMOD Output

Explaining Example -

  • SYSUT1 DD DSN=MATEPK.IEBCOPY.INPLOAD,.. - Specifies the input load PDS.
  • SYSUT2 DD DSN=MATEPK.IEBCOPY.OUTLOAD,.. - Specifies the output load PDS.
  • COPYMOD OUTDD=SYSUT2,INDD=SYSUT1,MAXBLK=13030 - Copies members from load members from SYSUT1 to SYSUT2.