JCL

IEBGENER and IEBCOPY utility JCL Reference

IEBGENER and IEBCOPY are IBM utilities used for various operations. 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. You can also use IEBCOPY to create a backup of a partitioned data set into a sequential data set (called an unload data set or PDSU), and to copy members from the backup into a partitioned data set. With IEBCOPY, you are able to perform any of the following

  • 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 PDS or PDSE data set, a member and its aliases together as a group (COPYGROUP)

IEBCOPY – Copy an entire PDS to another PDS

//COPYPDS JOB (COPYPDS,SAMPLE),'SATYA',
// CLASS=A,MSGCLASS=Z,REGION=0M,NOTIFY=&SYSUID
//*
//STEP1 EXEC PGM=IEBCOPY
//***********************************************
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DSN=XXXX.JCLTEST.SATYA.JCLS,DISP=SHR
//SYSUT2 DD DSN=XXXX.JCLTEST.SATYA.JCLS.BKUP,
//          DISP=(NEW,CATLG,DELETE),
//          UNIT=TESTDA,
//          SPACE=(CYL,(10,10,40)),
//          DCB=(RECFM=FB,LRECL=80,BLKSIZE=800)
//SYSIN DD *
  COPY INDD=SYSUT1,OUTDD=SYSUT2
/*

Note: input and output data sets are identified as SYSUT1 and SYSUT2, the SYSIN data set is optional. The SYSUT1 data set will be copied in full to the SYSUT2 data set. After the copy operation is finished, DATASET4 will contain the same members that are in DATASET5. However, there will be no embedded, unused space in DATASET4. If you are copying a PDSE, the processing is the same, except that there is no embedded, unused space in a PDSE.

IEBCOPY – Merge Multiple Data Sets

//MERGEDS JOB (SATYA,SAMPLE),'SATYA',
// CLASS=J,MSGCLASS=Z,REGION=0M,NOTIFY=&SYSUID
//*
//STEP1 EXEC PGM=IEBCOPY
//************************************************
//SYSPRINT DD SYSOUT=*
//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
/*

IEBCOPY – Copy and Replace Selected Members of a Data Set

//COPYRPLC JOB (SATYA,SAMPLE),'SATYA',
// CLASS=J,MSGCLASS=Z,REGION=0M,NOTIFY=&SYSUID
//*
//STEP1 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)
/*

IEBCOPY – Copy an entire PDS to a sequential tape data set (Unloading)

//UNLOADPDS JOB (SATYA,SAMPLE),'SATYA',
//    CLASS=J,MSGCLASS=Z,REGION=0M,NOTIFY=&SYSUID
//*
//STEP1 EXEC PGM=IEBCOPY
//**********************************************
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DSN=XXXX.JCLTEST.SATYA.JCLS,DISP=SHR
//SYSUT2 DD DSN=XXXX.JCLTEST.SATYA.JCLS.UNLOAD,
//          DISP=(NEW,CATLG),
//          UNIT=CART,
//          DCB=(LRECL=80,RECFM=FB,BLKSIZE=0)
//SYSIN DD *
  COPY INDD=SYSUT1,OUTDD=SYSUT2
/*

IEBCOPY – Loade (Restore Unloaded copy from Tape to DASD)

//LOADUNLD JOB (SATYA,SAMPLE),'SATYA',
// CLASS=J,MSGCLASS=Z,REGION=0M,NOTIFY=&SYSUID
//*
//STEP1 EXEC PGM=IEBCOPY
//********************************************************
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DSN=XXXX.JCLTEST.SATYA.JCLS.UNLOAD,DISP=SHR
//SYSUT2 DD DSN=XXXX.JCLTEST.SATYA.JCLS.LOADED,
//          DISP=(NEW,CATLG),
//          UNIT=TESTDA,
//          SPACE=(CYL,(10,10,40),RLSE),
//          DCB=(LRECL=80,RECFM=FB,BLKSIZE=0)
//SYSIN DD *
  COPY INDD=SYSUT1,OUTDD=SYSUT2
/*

IEBCOPY – Compress datasets PDS

//COMPRPDS JOB (SATYA,SAMPLE),'SATYA',
// CLASS=J,MSGCLASS=Z,REGION=0M,NOTIFY=&SYSUID
//*
//STEP1 EXEC PGM=IEBCOPY
//*********************************************************
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DSN=XXXX.JCLTEST.SATYA.JCLS,DISP=SHR
//SYSIN DD *
  COPY INDD=SYSUT1,OUTDD=SYSUT1
/*

IEBCOPY – Include members of PDS in a COPY command

//PDSCOPY  JOB (SATYA,SAMPLE),'SATYA',
// CLASS=J,MSGCLASS=Z,REGION=0M,NOTIFY=&SYSUID
//*
//STEP1 EXEC PGM=IEBCOPY
//*********************************************************
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DSN=XXXX.JCLTEST.SATYA.PDSE.JCLS,DISP=SHR
//SYSUT2 DD DSN=XXXX.JCLTEST.SATYA.JCLS.IEBCOPY,
//          DISP=(NEW,CATLG,DELETE),
//          SPACE=(CYL,(5,5,5),RLSE),
//          DCB=(LRECL=80,RECFM=FB,BLKSIZE=800)
//SYSIN DD *
  COPY INDD=SYSUT1,OUTDD=SYSUT2
  SELECT MEMBER=(IEBCOPY1,IEBCOPY2,IEBCOPY3,IEBCOPY4, -
  IEBCOPY5,IEBCOPY6)
/*

IEBCOPY – Exclude members of PDS in a COPY command

//PDSCOPY  JOB (SATYA,SAMPLE),'SATYA',
// CLASS=A,MSGCLASS=Z,REGION=0M,NOTIFY=&SYSUID
//*
//STEP1 EXEC PGM=IEBCOPY
//*********************************************************
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DSN=XXXX.JCLTEST.SATYA.PDSE.JCLS,DISP=SHR
//SYSUT2 DD DSN=XXXX.JCLTEST.SATYA.JCLS.OTHERS,
//          DISP=(NEW,CATLG,DELETE),
//          SPACE=(CYL,(10,10,40),RLSE),
//          DCB=(LRECL=80,RECFM=FB,BLKSIZE=800)
//SYSIN DD *
  COPY INDD=SYSUT1,OUTDD=SYSUT2
  EXCLUDE MEMBER=(IEBCOPY1,IEBCOPY2,IEBCOPY3,IEBCOPY4, -
  IEBCOPY5,IEBCOPY6)
/*

IEBCOPY – Rename a member while copying

//RENAMECPY JOB (SATYA,SAMPLE),'SATYA',
// CLASS=J,MSGCLASS=Z,REGION=0M,NOTIFY=&SYSUID
//*
//STEP1 EXEC PGM=IEBCOPY
//*********************************************************
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DSN=XXXX.JCLTEST.SATYA.PDSE.JCLS,DISP=SHR
//SYSUT2 DD DSN=XXXX.JCLTEST.SATYA.JCLS.IEBCOPY,
//       DISP=(NEW,CATLG,DELETE),
//       SPACE=(CYL,(5,5,5),RLSE),
//       DCB=(LRECL=80,RECFM=FB,BLKSIZE=800)
//SYSIN DD *
  COPY INDD=SYSUT1,OUTDD=SYSUT2
  SELECT MEMBER=(IEBCOPY1,IEBCOPY2,IEBCOPY3,IEBCOPY4,
  IEBCOPY5,(IEBCOPY6,NEWIEBC6))
/*

IEBCOPY – Merge Partitioned Data Sets

//MERGEPDS  JOB (SATYA,SAMPLE),'SATYA',
// CLASS=A,MSGCLASS=Z,REGION=0M,NOTIFY=&SYSUID
//*
//STEP1 EXEC PGM=IEBCOPY
//**********************************************************
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DSN=XXXX.JCLTEST.SATYA.JCLS.IEBCOPY,DISP=SHR
//SYSUT2 DD DSN=XXXX.JCLTEST.SATYA.JCLS.OTHERS,DISP=SHR
//SYSUT3 DD DSN=XXXX.JCLTEST.SATYA.JCLS.ALL,
//          DISP=(NEW,CATLG,DELETE),
//          SPACE=(CYL,(10,10,40),RLSE),
//          DCB=(LRECL=80,RECFM=FB,BLKSIZE=800)
//SYSIN DD *
  COPY INDD=(SYSUT1,SYSUT2),OUTDD=SYSUT3
/*

IEBGENER is a generalized copy utility used to the following tasks
• Create a backup copy of a sequential data set, a member of a partitioned data set or PDSE or a z/OS UNIX System Services (z/OS UNIX) file such as a HFS file.
• Produce a partitioned data set or PDSE, or a member of a partitioned data set or PDSE, from a sequential data set or a z/OS UNIX file.
• Expand an existing partitioned data set or PDSE by creating partitioned members and merging them into the existing data set.
• Produce an edited sequential or partitioned data set or PDSE.
• Manipulate data sets containing double-byte character set data.
• Print sequential data sets, members of partitioned data sets or PDSEs or z/OS UNIX files.
• Reblock or change the logical record length of a data set.
• Copy user labels on sequential output data sets.
• Supply editing facilities and exits for your routines that process labels, manipulate input data, create keys, and handle permanent input/output errors.

IEBGENER JCL

//JS10 EXEC PGM=IEBGENER,REGION=1024K
//SYSPRINT DD SYSOUT=* *MESSAGES
//SYSUT1 DD DSN=…,DISP=… *SEQUENTIAL INPUT FILE
//SYSUT2 DD DSN=…,DISP=… *OUTPUT FILE
//SYSIN DD *
CONTROL STATEMENTS
/*

IEBGENER Examples

//SATYJOB1 JOB (SATYA,SAMPLE),'SATYA',
// CLASS=A,MSGCLASS=Z,REGION=0M,NOTIFY=&SYSUID
//*
//STEP1 EXEC PGM=IEBGENER //*********************************************
//SYSPRINT DD SYSOUT=*
//SYSIN DD DUMMY
//SYSUT1 DD *
  AJITH TVM MCA 15000 12345678
  AJAY TVM MCA 18000 11111111
  ANIL TVM BTECH 15000 22222222
  SAJAN TVM MCA 18000 12121212
  KIRAN TVM MCA 15000 33333333
  THOMAS TVM BTECH 18000 13131313
  PHILIP TVM MCA 15000 21212121
  MANU TVM MCA 18000 34343434
  JAYA CHANDRAN TVM BTECH 15000 45544554
  ARUN TVM BTECH 18000 78654321
/*
//SYSUT2 DD DSN=XXXX.JCLTEST.SATYA.WORK.SRTINPUT,
//       DISP=(NEW,CATLG,DELETE),
//       UNIT=TESTDA,
//       SPACE=(CYL,(1,1),RLSE),
//       DCB=(RECFM=FB,LRECL=80,BLKSIZE=800)
//*

IEBGENERCreate back up of a PDS/PDSE member to another PDS/PDSE member

//SATYAJOB2 JOB (SATYA,SAMPLE),'SATYA',
// CLASS=A,MSGCLASS=Z,REGION=0M,NOTIFY=&SYSUID
//*
//STEP1 EXEC PGM=IEBGENER //****************************************************
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DSN=XXXX.JCLTEST.SATYA.PDSE.JCLS(IEBGEN2),
//          DISP=SHR
//SYSUT2 DD DSN=XXXX.JCLTEST.SATYA.PDSE.JCLS(IEBGEN3),
//          DISP=SHR,
//          UNIT=TESTDA,
//          SPACE=(CYL,(1,1),RLSE),
//          DCB=(RECFM=FB,LRECL=80,BLKSIZE=800)
//SYSIN DD DUMMY
//SYSUDUMP DD SYSOUT=*

IEBGENER – Create backup copy of a sequential data set to another sequential dataset

//SATYAJOB3 JOB (SATYA,SAMPLE),'SATYA',
// CLASS=A,MSGCLASS=Z,REGION=0M,NOTIFY=&SYSUID
//*
//STEP1 EXEC PGM=IEBGENER
//*********************************************************
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DSN=XXXX.JCLTEST.SATYA.WORK.SRTINPUT,
// DISP=SHR
//SYSUT2 DD DSN=XXXX.JCLTEST.SATYA.WORK.SRTINBK,
//       DISP=(NEW,CATLG,DELETE),
//       UNIT=TESTDA,
//       SPACE=(CYL,(1,1),RLSE),
//       DCB=(RECFM=FB,LRECL=80,BLKSIZE=800)
//SYSIN DD DUMMY
//SYSUDUMP DD SYSOUT=*

IEBGENER – Create backup copy of a sequential data set to a member of a PDS/PDSE

//SATYJOB3 JOB (SATYA,SAMPLE),'SATYA',
// CLASS=A,MSGCLASS=Z,REGION=0M,NOTIFY=&SYSUID
//*
//STEP1 EXEC PGM=IEBGENER
//********************************************************
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DSN=XXXX.JCLTEST.SATYA.WORK.SRTINPUT,
//       DISP=SHR
//SYSUT2 DD DSN=XXXX.JCLTEST.SATYA.WORK(SRTINBK),
//       DISP=SHR,
//       UNIT=TESTDA,
//       SPACE=(CYL,(1,1),RLSE),
//       DCB=(RECFM=FB,LRECL=80,BLKSIZE=800)
//SYSIN DD DUMMY
//SYSUDUMP DD SYSOUT=*

IEBGENERCreate backup copy of a PDS/PDSE member to a sequential data set

//SATYJOB4  JOB (SATYA,SAMPLE),'SATYA  ',
// CLASS=A,MSGCLASS=Z,REGION=0M,NOTIFY=&SYSUID
//*
//STEP1 EXEC PGM=IEBGENER
//*********************************************************
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DSN=XXXX.JCLTEST.SATYA.WORK(SRTINBK),
//       DISP=SHR
//SYSUT2 DD DSN=XXXX.JCLTEST.SATYA.WORK.SRTBKUP,
//       DISP=(NEW,CATLG,DELETE),
//       UNIT=TESTDA,
//       SPACE=(CYL,(1,1),RLSE),
//       DCB=(RECFM=FB,LRECL=80,BLKSIZE=800)
//SYSIN DD DUMMY
//SYSUDUMP DD SYSOUT=*

IEBGENERCreate PDSE from a PDS member

//SATYJOB5  JOB (SATYA,SAMPLE),'SATYA',
// CLASS=A,MSGCLASS=Z,REGION=0M,NOTIFY=&SYSUID
//*
//STEP1 EXEC PGM=IEBGENER //*****************************************************
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DSN=XXXX.JCLTEST.SATYA.WORK(SRTINBK),
//       DISP=SHR
//SYSUT2 DD DSN=XXXX.JCLTEST.SATYA.PDSE.WORK(SRTINBK),
//       DISP=(NEW,CATLG,DELETE),
//       UNIT=TESTDA,
//       DSORG=PO,
//       DSNTYPE=LIBRARY,
//       SPACE=(CYL,(1,1),RLSE),
//       DCB=(RECFM=FB,LRECL=80,BLKSIZE=800)
//SYSIN DD DUMMY
//SYSUDUMP DD SYSOUT=*

IEBGENERChange the block size of an existing sequential data set to another new sequential data set

//SATYJOB6 JOB (SATYA,SAMPLE),'SATYA',
// CLASS=A,MSGCLASS=Z,REGION=0M,NOTIFY=&SYSUID
//*
//STEP1 EXEC PGM=IEBGENER //****************************************************
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DSN=XXXX.JCLTEST.SATYA.WORK.SRTINPUT,
//       DISP=SHR,
//       DCB=(RECFM=FB,LRECL=80,BLKSIZE=800)
//SYSUT2 DD DSN=XXXX.JCLTEST.SATYA.WORK.SRTINPUT.NEWBS,
//       DISP=(NEW,CATLG,DELETE),
//       UNIT=TESTDA,
//       SPACE=(CYL,(1,1),RLSE),
//       DCB=(RECFM=FB,LRECL=80,BLKSIZE=32000)
//SYSIN DD DUMMY
//SYSUDUMP DD SYSOUT=*

You will get error if you try the following JCL

//SATYJOB7 JOB (SATYA,SAMPLE),'SATYA',
// CLASS=A,MSGCLASS=Z,REGION=0M,NOTIFY=&SYSUID //*
//STEP1 EXEC PGM=IEBGENER
//*********************************************************
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DSN=XXXX.JCLTEST.SATYA.WORK,
// DISP=SHR
//SYSUT2 DD DSN=XXXX.JCLTEST.SATYA.WORK.BKUP,
//       DISP=(NEW,CATLG,DELETE),
//       UNIT=TESTDA,
//       SPACE=(CYL,(10,10,100),RLSE),
//       DCB=(RECFM=FB,LRECL=80,BLKSIZE=800)
//SYSIN DD DUMMY
//SYSUDUMP DD SYSOUT=*

Where, XXXX.JCLTEST.SATYA.WORK and XXXX.JCLTEST.SATYA.WORK.BKUP are PDS

You will get errors like this.
E1 8 DSS20027E DDNAME 'SYSUT1', DSN 'XXXX.JCLTEST.SATYA.WORK' SHOULD HAVE
BEEN A PHYSICAL SEQUENTIAL DATA SET. ACTUAL DSORG IS PO.
E2 8 DSS20027E DDNAME 'SYSUT2', DSN 'XXXX.JCLTEST.SATYA.WORK.BKUP' SHOULD
HAVE BEEN A PHYSICAL SEQUENTIAL DATA SET. ACTUAL DSORG IS PO. 

Read JCL blogs: Click Here   SYNCSORT Manual: Click Here

Admin

Share
Published by
Admin

Recent Posts

Increase Transparency and Collaboration Product Backlog

A well-maintained product backlog is crucial for successful product development. It serves as a single…

3 weeks ago

Product Backlog – Incremental value to the customer

Incremental value to the customer refers to the gradual delivery of small, functional parts of…

4 weeks ago

Product Market, Customer’s Desire, Need, and Challenges

A Product Market refers to the group of potential customers who might be interested in…

4 weeks ago

PAL-EBM Professional Agile Leadership – EBM Certification

The Professional Agile Leadership - Evidence-Based Management (PAL-EBM) certification offered by Scrum.org is designed for…

4 months ago

PAL I Professional Agile Leadership Certification

The Professional Agile Leadership (PAL I) certification, offered by Scrum.org, is designed to equip leaders…

4 months ago

Scrum Master Certification: CSM, PSM, SSM

Choosing the right Scrum Master Certification depends on your current experience and career goals. If…

6 months ago