Let's understand Mainframe
Home Tutorials Interview Q&A Quiz Mainframe Memes Contact us About us

Module 6: JCL Utilities


IEBGENER

IEBGENER is referred as copy utility and mostly used to copy one PS to another PS

Other use includes:-

  • Create a copy of a sequential dataset, or a member of a PDS or PDSE
  • Create a PDS or PDSE, or a member of either, from a sequential dataset
  • To concatenate datasets
  • Can be used to change block size or logical record length of dataset
  • To specify conditions while copying
  • To write in-stream data into a dataset
  • Handle the Double Byte Character Set (DBCS) data
  • It provides an exit or editing capabilities for label processing, input data editing, key creation, or permanent I/O error processing.

General Format:-

//STEPNAME EXEC PGM=IEBGENER //SYSPRINT DD SYSOUT=* //SYSUT1 DD DSN=...,DISP=... //SYSUT2 DD DSN=...,DISP=... //SYSIN DD * control statements... //

While using IEBGENER utility, required DDs are SYSPRINT (for output messages), SYSUT1 (input), SYSUT2 (output) and SYSIN (control card).

Let’s see how we can use IEBGENER to achieve different purposes:-

To copy sequential dataset

//STEPNAME EXEC PGM=IEBGENER //SYSPRINT DD SYSOUT=* //SYSUT1 DD DSN=<input dataset which needs to be copied> //SYSUT2 DD DSN=<output dataset where data will be written> //SYSIN DD DUMMY //

  • SYSUT1 (input) and SYSUT2 (output) dataset can be a PS or member of PDS
  • SYSIN specified DUMMY since there is no need to add control statements when we are just copying ‘one PS to another PS’, ‘member of PDS to another member of PDS’ and ‘PS to a member of PDS’ or vice-versa
  • These format can be used while we take backup of files or in case where space allocation needs to be increased

To concatenate datasets

//STEPNAME EXEC PGM=IEBGENER //SYSPRINT DD SYSOUT=* //SYSUT1 DD DSN=<input dataset 1 which needs to be copied> // DD DSN=<input dataset 2 which needs to be copied > //SYSUT2 DD DSN= //SYSIN DD DUMMY //

  • While coding dataset SYSUT1 we can specify multiple dataset name and when this step executes, the resultant SYSUT2 dataset will have concatenated data.

To write in-stream data

//STEPNAME EXEC PGM=IEBGENER //SYSPRINT DD SYSOUT=* //SYSUT1 DD <In-stream data> /* //SYSUT2 DD DSN= //SYSIN DD DUMMY //

To empty existing file

//STEPNAME EXEC PGM=IEBGENER //SYSPRINT DD SYSOUT=* //SYSUT1 DD DUMMY //SYSUT2 DD DSN=<output dataset which already exist>,DISP=OLD //SYSIN DD DUMMY //

  • Same way we can specify new dataset while coding SYSUT2 in case we have to allocate and empty dataset






© copyright mainframebug.com
Privacy Policy