Wednesday, June 18, 2014

JOB Utilities IEBGENER

IEBGENER 

IEBGENER is a generalized copy utility used to perform 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 uses the following input:

  • An input data set, which contains the data that is to be copied, edited, converted into a partitioned data set or PDSE, or converted into members to be merged into an existing data set. The input is either a sequential data set or a member of a partitioned data set or PDSE.
  • A control data set, which contains utility control statements. The control data set is required if editing is to be performed or if the output data set is to be a partitioned data set or PDSE.
  • The PARM parameter on the JCL EXEC statement or the dynamic invocation equivalent.
  • IEBGENER produces the following output:
  • An output data set, which can be either sequential, including large format sequential, or partitioned. The output data set can be either a new data set (created during the current job step) |or an existing data set. It can be a sequential data set or |a PDS or PDSE that will be expanded. If a partitioned data set or PDSE is created, it is a new member with a new directory entry. None of the information is copied from the previous directory entry. |The same sequential data set cannot be used as both the input |and output data set. The |output sequential data set cannot be any of the input data sets in a sequential |concatenation.
  • A message data set, which contains informational messages (for example, the contents of utility control statements) and any error messages.


General structure

//JS10    EXEC PGM=IEBGENER,REGION=1024K
//SYSPRINT DD SYSOUT=*                 
//SYSUT1   DD DSN=...,DISP=...         
//SYSUT2   DD DSN=...,DISP=...         
//SYSIN    DD *                        
 control statements...
/*

IEBGENER requires four data definition (DD) statements with the DD names shown in the example:

SYSIN DD specifies control statements. This can be on DASD, TAPE or in-stream data. The SYSIN block size must be multiple of 80, with a maximum allowed BLKSIZE of 32,720, and a RECFM of F or FB; for simple uses, no control parameters are needed and a DD DUMMY can be used.

SYSPRINT DD statement is required and must have RECFM=FB or F. The BLKSIZE value can be any value up to 32670 that is a multiple of 121. It is used to display messages from IEBGENER.

SYSUT1 DD statement points to the input file for the IEBGENER operation.  This file can be RECFM=F, FB, V, VS, VB, VBS, or U.  The BLKSIZE must be specified in the data set label or via JCL.  Variable Spanned (RECFM=VS or VBS) records cannot be copied to the output file if the output file is a PDS or PDSE.

SYSUT2 DD statement points to the output file for the IEBGENER operation.  This file can be RECFM=F, FB, V, VS, VB, VBS, or U.  PDS or PDSE libraries cannot have a RECFM of VS or VBS.  Reblocking is accomplished if the SYSUT2 BLKSIZE is a new maximum blocksize.  RECFM must be specified for the SYSUT2 file if the data set is new or DUMMY.  BLKSIZE must always be specified for the SYSUT2 DD statement if LRECL and RECFM are also specified.

A partitioned data set or PDSE cannot be produced if an input data set contains spanned records.
If both the SYSUT1 and the SYSUT2 DD statements specify standard user labels (SUL), IEBGENER copies user labels from SYSUT1 to SYSUT2


IEBGENER Control Statements:

Valid control statements are GENERATE, EXITS, LABELS, MEMBER, and RECORD.  Control statements are continued by placing a non-blank character in column 72, and continuing the statement beginning in column 16 on the next statement.  The syntax and usage of each is discussed below:

GENERATE:

The GENERATE control statement is required when:

1. The output data set is partitioned, or
2. Editing is to be performed, or
3. User routines are provided and/or label processing is to be done.

The format of the GENERATE statement is:

{label}    GENERATE MAXNAME=n
           {,MAXFLDS=n}
           {,MAXGPS=n}
           {,MAXLITS=n}
           {,DBCS={YES ¦ NO}}

The MAXNAME, MAXFLDS, MAXGPS, and MAXLITS parameters set limits on the number of member names, FIELDS, IDENTS, and character literals that will follow on subsequent RECORD and MEMBER statements. If you use the GENERATE statement, make sure these four parameters are set to high enough values. Use DBCS=YES whenever the input file has double-byte character set data included.

RECORD:

The RECORD statement defines a record group and provides editing directions to IEBGENER.  The RECORD control statement is required when:

1. The output data set is partitioned, or
2. Editing is to be performed, or
3. User routines are provided and/or label processing is to be done.

In a RECORD statement, one IDENT parameter can be used to identify a record group, one or more FIELD parameters can be used to describe editing to be done on records in the record group, and a LABELS parameter can be used to indicate that this statement is immediately followed by user label records. The format of the RECORD statement is:

{label} RECORD {{IDENT¦IDENTG}=(length,'name',input-location)}
                {,FIELD=({length}
                         {,input-location ¦ 'literal'}
                         {,conversion}
                         {output-location}),{FIELD=...}
                {,LABELS=n}

The variables on the FIELDS= parameter are positional; if any of the options are not coded, the associated comma preceding that variable must be coded.

The {IDENT¦IDENTG}= parameter identifies the last record of the input group to which the FIELD parameters apply. IDENT is used for single-byte character string, and IDENTG for double-byte character strings (DBCS).  The last record is identified by the literal given by 'name', which must have the given length and input location relative to 1.  Use X'name' for hexadecimal names.

The FIELD= parameter supplies field-processing and editing information. 'Length' and 'input-location' identify a field to be processed, 'literal' is a literal value to be placed in the specified 'output-location', and 'conversion' is either CG (shift-out/shift-in characters removed no DBCS validation), CV (DBCS validation and input contains both single and double-byte character set data),  GC (shift-in/shift-out characters inserted for DBCS data),  GV (DBCS data not in shift-in/shift-out characters and data validation),  HE (H-set BCD data converted to EBCDIC),  PZ (packed to zoned),  VC (DBCS validation and data not in shift-in/shift-out characters),  VG (DBCS data validation and eliminate shift-in/shift-out characters), or ZP (zoned to packed). Use X'literal' for hexadecimal literal values.

LABELS= (optional) is a number from 1 to 8 that identifies the number of records in the SYSIN stream to treat as user label records. DATA=INPUT on a LABELS statement must precede it in the input stream.

MEMBER:

The MEMBER statement is used when the output data set is to be a PDS/PDSE. One MEMBER statement must be included for each member being created.  All RECORD statements that follow a MEMBER statement refer to the member named by that statement.  If a MEMBER statement is not included, the output data set will be sequential.  The format of the MEMBER statement is:

{label}   MEMBER NAME=(name{,alias}...)

'name' and 'alias' are member names and aliases desired for the ember.  Multiple aliases are allowed.

LABELS:

The LABELS statement indicates the disposition of user labels hen processed by IEBGENER.  LABELS should be specified when:

1. User labels are not to be copied to the output data set, or
2. Retrieved user labels from records in the data portion of the SYSIN data set, or
3. The user's exit routine is invoked before the user labels are copied to the output data set.

If multiple LABELS statements are present, only the last one encountered is used.  The format of the LABELS statement is:

{label}   LABELS {DATA=YES¦NO¦ALL¦ONLY¦INPUT}

DATA=YES is the default. "YES" means that if the user labels are not rejected by your user label exit module, they will be processed as data.  "NO" means, do not process user labels as data.  "ALL" means, treat all user labels in the current group being processed as data.  "ONLY" means,  treat header labels only as data.  "INPUT" means, that user labels for the output data set are to be copied from the data part of the SYSIN data set, and the number of records to read is specified in the RECORD statement.

EXITS:

The EXITS statement provides that names of user exit routines to be used in processing user labels. The format of the EXITS statement is:

Format -

{label}   EXITS {INHDR=routinename}
                {,OUTHDR=routinename}
                {,INTLR=routinename}
                {,OUTTLR=routinename}
                {,KEY=routinename}
                {,DATA=routinename}
                {,IOERROR=routinename}
                {,TOTAL=routinename,size}

The EXITS statement provides the names of the exit routines to be user for the function identified above.  Usage of all of these exits is optional.  'INHDR' identifies the input header exit routine. 'OUTHDR' identifies the output header exit routine. 'INTLR' identifies the input trailer exit routine. 'OUTTLR' identifies the output trailer exit routine. 'KEY' identifies the output create record key exit routine, not invoked for LRECL VS or VBS records. 'DATA' identifies the pre processing record exit routine. 'IOERROR' identifies the permanent I/O error exit routine. 'TOTAL' identifies the pre record output exit routine, where "size" is a decimal number identifying the bytes required for processing.

IEBGENER usage examples
Copy datasets

//STEPCOPY EXEC PGM=IEBGENER
//SYSUT1   DD DSN=MUK001A.OLDFILE1,DISP=SHR
//SYSUT2   DD DSN=MUK001A.NEWFILE,
//         DISP=(NEW,CATLG,DELETE),
//         UNIT=SYSDA,
//         SPACE=(CYL(2,2),RLSE),
//         DCB=(LRECL=80,BLKSIZE=0,RECFM=FB,DSORG=PS),
//         MGMTCLAS=*
//SYSPRINT DD SYSOUT=*
//SYSOUT   DD SYSOUT=*
//SYSIN    DD DUMMY


Concatenate datasets 

//STEPCONC EXEC PGM=IEBGENER
//SYSUT1   DD DSN=MUK001A.OLDFILE1,DISP=SHR
//         DD DSN=MUK001A.OLDFILE2,DISP=SHR
//         DD DSN=MUK001A.OLDFILE3,DISP=SHR
//SYSUT2   DD DSN=MUK001A.NEWFILE,
//         DISP=(NEW,CATLG,DELETE),
//         UNIT=SYSDA,
//         SPACE=(CYL(2,2),RLSE),
//         DCB=(LRECL=80,BLKSIZE=0,RECFM=FB,DSORG=PS),
//         MGMTCLAS=A
//SYSPRINT DD SYSOUT=*
//SYSOUT   DD SYSOUT=*
//SYSIN    DD DUMMY


Empty existing files

//STEPEMPT EXEC PGM=IEBGENER
//SYSUT1   DD DUMMY,
//         DCB=(LRECL=80,BLKSIZE=0,RECFM=FB,DSORG=PS)
//SYSUT2   DD DSN=MUK001A.EMPTFILE,
//         DISP=(OLD)
//SYSPRINT DD SYSOUT=*
//SYSOUT   DD SYSOUT=*
//SYSIN    DD DUMMY


Allocate empty files

//STEPEMPT EXEC PGM=IEBGENER
//SYSUT1   DD DUMMY,
//         DCB=(LRECL=80,BLKSIZE=0,RECFM=FB,DSORG=PS)
//SYSUT2   DD DSN=MUK001A.EMPTFILE,
//         DISP=(NEW,CATLG,DELETE),
//         UNIT=SYSDA,
//         SPACE=(CYL(2,2),RLSE),
//         DCB=(LRECL=80,BLKSIZE=0,RECFM=FB,DSORG=PS),
//         MGMTCLAS=A 
//SYSPRINT DD SYSOUT=*
//SYSOUT   DD SYSOUT=*
//SYSIN    DD DUMMY

Create a PDS from sequential dataset

//CREATPDS EXEC PGM=IEBGENER
//SYSUT1   DD DSN=MY.SEQ.FILE.LIB,DISP=SHR
//SYSUT2   DD DSN= MY.PDS.FILE.LIB,DISP=SHR 
//SYSPRINT DD SYSOUT=*
//SYSOUT   DD SYSOUT=*
//SYSIN    DD *
GEN1  GENERATE MAXNAME=4,MAXGPS=3
MEM1  MEMBER  NAME=JOBCARD
GRP1  RECORD   IDENT=(8,'//* NJOB',1),
MEM2  MEMBER  NAME=JESCARDS
GRP2  RECORD   IDENT=(8,'//* NJES',1),
MEM3  MEMBER  NAME=JCLCARDS
GRP3  RECORD   IDENT=(7,'* TOP *',1),
MEM4  MEMBER  NAME=RPTDATA
GRP4  RECORD   IDENT=(8,'*BOTTOM*',1)


Copy CMS file to disk having data in first 35 characters

//COPYSTEP EXEC PGM=IEBGENER
//SYSUT1   DD DSN=,DISP=SHR
//SYSUT2   DD DSN=,DISP=OLD 
//SYSPRINT DD SYSOUT=*
//SYSOUT   DD SYSOUT=*
//SYSIN    DD *
  GENERATE MAXFIELDS=1
  RECORD FIELDS=(35,1,,1)

Copy file to disk after inserting an identifier

//COPYSTEP EXEC PGM=IEBGENER
//SYSUT1   DD DSN=,DISP=SHR
//SYSUT2   DD DSN=,DISP=OLD 
//SYSPRINT DD SYSOUT=*
//SYSOUT   DD SYSOUT=*
//SYSIN    DD *
  GENERATE MAXFIELDS=2,MAXLITS=7
  RECORD FIELDS=(7,'USC1280',,1),FIELD=(80,1,,8)


* Print a Sequential Data Set

//PRINT    JOB  ...
//STEP1    EXEC PGM=IEBGENER
//SYSPRINT DD  SYSOUT=A
//SYSIN    DD  DUMMY
//SYSUT1   DD  DSNAME=D80.DATA,DISP=SHR
//SYSUT2   DD  SYSOUT=A

* Produce Blocked File  from Unblocked Disk File

  //COPYJOB  JOB
  //STEP1    EXEC PGM=IEBGENER,REGION=318K
  //SYSPRINT DD  SYSOUT=A
  //SYSIN    DD  DUMMY
  //SYSUT1   DD  DSNAME=INPUT,UNIT=disk,
  //             DISP=OLD,VOL=SER=X13380,
  //             DCB=(BUFNO=20,RECFM=F,LRECL=2000,BLKSIZE=2000)
  //SYSUT2   DD  DSNAME=OUTPUT,UNIT=disk,DISP=(NEW,KEEP),
  //             DCB=(RECFM=FB,LRECL=2000,BLKSIZE=32000)

No comments:

Post a Comment