Copying & Reblocking Load Modules


Summary

For basic information, go through the IEBCOPY Utility (for Beginners)

  • The COPYMOD statement lets COPY and reblocks the load modules to the appropriate block size for the target device.
  • The block size in the output data set is increased by COPYMOD as required to match the MAXBLK value.
  • COPYMOD does not write records longer than the output data set block size.
  • IEBCOPY determines the amount of space remaining on a track before assigning a size to the next block to be written.
  • The maximum block size produced 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----+----6----+----7--
***************************** Top of Data ******************************
//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                       
/*                                                                      
**************************** Bottom of Data ****************************

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.