Control Statements


IEBGENER utility has two types of statements to perform the task, and those are -

  • Job Control Statements
  • Utility Control Statements

Job Control Statements -


The job control statements are required to run IEBGENER to complete the task. Those are -

StatementUsage
JOB Starts JOB execution.
EXEC Starts executing the IEBGENER utility.
SYSPRINT DD Mandatory. It is used for listing control statements and messages.
SYSUT1 or
anyname1 DD
Mandatory. It defines a PDS or unload data set for input.
SYSUT2 or
anyname2 DD
Mandatory. It defines a PDS or unload data set for output.
SYSUT3 DD Optional temp data set and is used when there is no space in virtual storage for some or all of the current input data set directory entries.
SYSUT4 DD Optional temp data set and is used when there is no space in virtual storage for the output data set directory.
SYSIN DD Mandatory control data set and is used to code utility control statements are optional.

Utility Control Statements -


IEBGENER also has its own control statements and it controls the functions of copy. If no utility control statements are coded, the entire input data set gets copied sequentially.

The IEBGENER utility control statements are -

  • GENERATE
  • RECORD
  • MEMBER
  • EXITS
  • LABELS

GENERATE Statement


The GENERATE statement can be used while copying and reformatting data during copying. It is coded when output is partitioned, editing is performed, or label processing.

Syntax -

//SYSIN DD *
  GENERATE [MAXNAME=n][,MAXFLDS=n]
       [,MAXGPS=n][,MAXLITS=n]
/*

Example -

Scenario - Copy sequential file records upto 'E0005' into a PDS member (PDS is already created).

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.OUTPDS,DISP=OLD 
//SYSIN    DD  *
  GENERATE MAXNAME=1,MAXGPS=1
    MEMBER NAME=MEMBER4
    RECORD IDENT=(5,'E0005',1)
/*
...

RECORD Statement


The RECORD statement defines a record group with editing information. A record group consists of records that are to be processed identically.

Syntax -

//SYSIN DD *
  RECORD [{IDENT|IDENTG}=(length,'name',input-location)]
  [,FIELD=([length],[{input-location|'literal'}],
  [conversion],[output-location])]
  [,FIELD=...][,LABELS=n]
/*

Example -

Scenario - Add literals to the records of the PS file.

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)
/*
...

MEMBER Statement


MEMBER statement specifies the member name or member alias of a output PDS or PDSE.

Syntax -

//SYSIN DD *
  MEMBER NAME=(name[,alias 1][,alias 2][,...])
/*

Example -

Scenario - Copy sequential file records into a new PDS members.

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.OUTPDS,
//            DISP=(NEW,CATLG,DELETE),
//            SPACE=(TRK,(10,10,10),RLSE),
//            UNIT=SYSDA,
//            DCB=(DSORG=PO,RECFM=FB,LRECL=80,BLKSIZE=800)
//SYSIN    DD  *
  GENERATE MAXNAME=1
    MEMBER NAME=MEMBER5
/*
...

EXITS Statement


The EXITS statement is used to identify exit routines IEBGENER to use.

Syntax -

//SYSIN DD *
  EXITS [INHDR=routinename][,OUTHDR=routinename]
	[,INTLR=routinename][,OUTTLR=routinename]
	[,KEY=routinename][,DATA=routinename]
	[,IOERROR=routinename][,TOTAL=(routinename,size)]
/*

Example -

Scenario - Split sequential file records into three new PDS members.

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.OUTPDS,
//            DISP=(NEW,CATLG,DELETE),
//            SPACE=(TRK,(10,10,10),RLSE),
//            VOL=SER=DEVHD4,UNIT=3390,
//            DCB=(DSORG=PO,RECFM=FB,LRECL=80,BLKSIZE=800)
//SYSIN    DD  *
  GENERATE MAXNAME=3,MAXGPS=2
     EXITS IOERROR=ERRORRT
    MEMBER NAME=MEMBER1
    RECORD IDENT=(5,'E0003',1)
    MEMBER NAME=MEMBER2
    RECORD IDENT=(5,'E0005',1)
    MEMBER NAME=MEMBER3
/*
...

LABELS Statement


The LABELS statement is used to decide whether the labels are to copied or not to the output file. It is used when -

  • no user labels are to be copied.
  • user labels are to be copied from the SYSIN control card.
  • user labels are to be copied after the user's label processing routines modify them.

Syntax -

//SYSIN DD *
  LABELS [DATA={YES|NO|ALL|ONLY|INPUT}]
/*

Example -

Scenario - Edit and copy a sequential input data set with labels.

Input PS File - MATEPK.IEBGENER.INPUTPS1

JCL -

----+----1----+----2----+----3----+----4----+----5----+
...
//STEP10   EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSUT1   DD DSN=MATEPK.IEBGENER.INPUTPS1,DISP=SHR
//SYSUT2   DD DSN=MATEPK.IEBGENER.OUTPUTL,
//            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)
    LABELS DATA=INPUT
    RECORD LABELS=3
    .A .B .C
    RECORD LABELS=2
    .D .E
/*
...