IEBGENER Copy data by inserting literals
IEBGENER can insert literal values or fixed text into the copied data. This feature is useful when we need to add constant data, such as headers, footers, or markers, during the copy process.
These control statements allow us to generate new records with literal values and merge them with the data that is being copied. The RECORD statement is typically used to insert literals into the output data.
Practical Example -
Scenario - Insert the literal "=====" in the place of 1-5 or 75-80 characters
Input PS File - MATEPK.IEBGENER.INPUTPS
JCL -
----+----1----+----2----+----3----+----4----+----5----+
...
//STEP10 EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DSN=MATEPK.IEBGENER.INPUTPS,DISP=SHR
//SYSUT2 DD DSN=MATEPK.IEBGENER.OUTPUTPS,
// DISP=(NEW,CATLG,DELETE),
// SPACE=(TRK,(10,10),RLSE),
// UNIT=3390,VOL=SER=DEVHD4,
// DCB=(DSORG=PS,RECFM=FB,LRECL=80,BLKSIZE=800)
//SYSIN DD *
GENERATE MAXFLDS=3,MAXLITS=10
RECORD FIELD=(5,'=====',,1),
FIELD=(70,1,,6),
FIELD=(5,'=====',,76)
/*
...