COPYMOD
COPYMOD
COPYMOD statement is used to load module libraries that need to reblock. The input dataset may be a PDS or a PS created by an unload operation. The output dataset should be PDS.
Syntax -
//SYSIN DD *
[label] COPYMOD OUTDD=DDname,INDD={DDname|((DDname,R))}
[,MAXBLK={nnnnn|nnK}]
[,MINBLK={nnnnn|nnK}]
[,LIST={YES|NO}]
/*
- OUTDD=DDname - Specifies the DDname of the output PDS.
- INDD=[(]{DDname|(DDname,R) }[,...][)] - Specifies the DDname of the input PDS.
- R - Specifies that the members to be copied or loaded from the input PDS will replace any identically named members on the output PDS.
- MAXBLK={nnnnn|nnK} - Specifies the maximum block size for records in the output PDS.
The nnnnn value is a decimal number.
nnK tells that the nn value is to be multiplied by 1024 bytes. MAXBLK can be coded with or without MINBLK. - MINBLK={nnnnn|nnK} -Specifies the minimum block size for records in the output PDS.
The nnnnn value is specified as a decimal number.
nnK means that the nn value is to be multiplied by 1024 bytes. MINBLK can be coded with or without MAXBLK. - LIST={YES|NO} - Specifies that the altered member names to be listed in the SYSPRINT data set. When ignored, the default listing option from the EXEC PARM gets applied.
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 -
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.