Showing posts with label JCL Utilities. Show all posts
Showing posts with label JCL Utilities. Show all posts

Wednesday, June 18, 2014

JCL Utilities Table

Table 1. Tasks and Utility Programs
TaskOptionsPrimary UtilitySecondary Utilities
Adda member to a partitioned data setIEBUPDATE, IEBGENERIEBDG
a passwordIEHPROGM
Alter in placea load moduleIEBCOPY
Cataloga data set in a catalogIEHPROGM
Changedata set organizationIEBUPDTEIEBGENER, IEBPTPCH
logical record lengthIEBGENER
Comparez/OS UNIX System Services (z/OS UNIX) files such as HFS filesIEBCOMPR
partitioned data setsIEBCOMPR
sequential data setsIEBCOMPR
PDSEsIEBCOMPR
Compressa partitioned data setIEBCOPY
Compress in placea partitioned data setIEBCOPY
Convert to partitioned data setan unloaded PDSE containing program objects cannot be loaded into a PDS. An unloaded PDSE containing data objects can be loaded into a PDS but all extended attributes will be lost.IEBCOPY
sequential data setsIEBGENERIEBUPDTE
a PDSEIEBCOPY
Convert to PDSEa partitioned data setIEBCOPY
an unloaded copy of a partitioned data set or PDSEIEBCOPY
sequential data setsIEBGENERIEBUPDTE
Convert to sequential data seta partitioned data set or PDSEIEBGENERIEBUPDTE
Copya load module or load module libraryIEBCOPY
a partitioned data setIEBCOPYIEHMOVE
a volume of data sets (on tape or disk)IEHMOVE
job stepsIEBEDIT
selected members of a partitioned data setIEBCOPYIEHMOVE
sequential data setsIEBGENERIEHMOVE, IEBUPDTE, IEBPTPCH
a PDSEIEBCOPY
a group of PDSE membersIEBCOPY
selected members of a PDSEIEBCOPY
Createa backup copy of a partitioned data set or PDSEIEBCOPY
a character arrangement table moduleIEBIMAGE
a copy modification moduleIEBIMAGE
a 3800 or 4248 forms control buffer moduleIEBIMAGE
a graphic character modification moduleIEBIMAGE
a library character set moduleIEBIMAGE
a library of partitioned membersIEBGENERIEBUPDTE
a member of a partitioned data set or PDSEIEBGENERIEBDG, IEBUPDTE
a sequential output data setIEBDGIEBGENER, IEBPTPCH
an indexed sequential data setIEBDG
an output job streamIEBEDIT
Deletea data set or member of a partitioned data setIEHPROGM
passwordIEHPROGM
catalog entriesIEHPROGM
records in a partitioned data set or PDSE memberIEBUPDTE
Edit and convert to partitioned data set or PDSEa sequential data setIEBGENERIEBUPDTE
Edit and copya job streamIEBEDIT
a sequential data setIEBGENERIEBUPDTE, IEBPTPCH
Edit and listerror statistics by volume (ESV) recordsIFHSTATR
Edit and printa sequential data setIEBPTPCHIEBGENER
Edit and puncha sequential data setIEBPTPCHIEBGENER
Entera procedure into a procedure libraryIEBUPDTE
Excludea partitioned data set member from a copy operationIEBCOPYIEHMOVE
a PDSE member from a copy operationIEBCOPY
Expanda partitioned data set or PDSEIEBCOPY
a sequential data setIEBGENER
Generatetest dataIEBDG
Includechanges to members or sequential data setsIEBUPDTE
a partitioned data set member from a copy operationIEBCOPYIEHMOVE
a PDSE member from a copy operationIEBCOPY
Indicatedouble-byte character set string by supplying enclosing shift-out/shift-in charactersIEBGENERIEBPTPCH
Insert recordsinto a partitioned data set or PDSEIEBUPDTE
Labelmagnetic tape volumesIEHINITT
Lista password entryIEHPROGM
a volume table of contentsIEHLIST
number of unused directory blocks and tracksIEHLISTIEBCOPY
partitioned data set or PDSE directoriesIEHLISTIEHPROGM
CVOL entriesIEHLIST
Loadan unloaded partitioned data set to a partitioned data setIEBCOPY
an unloaded data setIEHMOVE
an unloaded partitioned data set to a PDSE (for non-load modules only)IEBCOPY
an unloaded PDSE to a partitioned data set (for non-load modules only)IEBCOPY
an unloaded PDSE to a PDSEIEBCOPY
Mergepartitioned data setsIEBCOPYIEHMOVE
PDSEsIEBCOPY
partitioned data sets and PDSEsIEBCOPY
Modifya partitioned or sequential data set, or a PDSEIEBUPDTE
Movea volume of data setsIEHMOVE
partitioned data setsIEHMOVE
sequential data setsIEHMOVE
Number recordsin a new or old member of a partitioned data set or PDSEIEBUPDTE
Password protectionadd a passwordIEHPROGM
delete a passwordIEHPROGM
list passwordsIEHPROGM
replace a passwordIEHPROGM
Printsequential data setsIEBPTPCHIEBGENER, IEBUPDTE
partitioned data sets or PDSEsIEBPTPCH
selected recordsIEBPTPCH
mixed strings of double-byte and single-byte character set dataIEBPTPCHIEBGENER
double-byte character set dataIEBPTPCHIEBGENER
Puncha partitioned data set memberIEBPTPCH
a sequential data setIEBPTPCH
selected recordsIEBPTPCH
mixed strings of double-byte and single-byte character set dataIEBPTPCHIEBGENER
Double-byte character set dataIEBPTPCHIEBGENER
Reblocka load moduleIEBCOPY
a partitioned data set or PDSEIEBCOPY
a sequential data setIEBGENERIEBUPDTE
Re-createa partitioned data set or PDSEIEBCOPY
Renamemember of a partitioned data set or PDSEIEBCOPYIEHPROGM
a sequential or partitioned data set, or PDSEIEHPROGM
moved or copied members of a partitioned data setIEHMOVE
Renumberlogical recordsIEBUPDTE
Removeindication of a double-byte character set string by stripping off enclosing shift-out/shift-in charactersIEBGENER
Replacea passwordIEHPROGM
logical recordsIEBUPDTE
records in a member of a partitioned data set or PDSEIEBUPDTE
selected members of a PDSEIEBCOPYIEBUPDTE
selected members of a partitioned data setIEBCOPYIEBUPDTE, IEHMOVE
Scratchdata setsIEHPROGM
Uncatalogdata setsIEHPROGM
Unloada partitioned data setIEBCOPYIEHMOVE
a sequential data setIEHMOVE
a PDSEIEBCOPY
Update in placea partitioned data set or PDSEIEBUPDTE

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)

JCL Utilities IEFBR14

IEFBR14

The first three letters of the utilities has specific usage like "IEF" for programs produced by the job management group, "IEB" for data set utility programs, "IEF" for system utility programs, and "IEW" for program-linkage and -loading.

And the next portion of the program name, for example "BR14" means "branch to register 14", IEBUPDTE was the dataset utility (IEB) that applied updates (UPDTE) to source code files, and IEHINITT was the system utility (IEH) that initialized (INT) magnetic tape labels (T).

IEFBR14 is a very popular utility in IBM mainframes. Even though it is very popular, the service provided by this utility is "nothing".(i.e) It is a "do nothing" utility. This utility runs in all the IBM environments derived from OS/360, including z/OS.

This utility module performs two simple functions:

1.  It loads register 15 with a value of 0
2.  It then does a branch to the address in register 14

Since register 14 is the standard IBM program linkage "return address" register, this immediately returns control to the calling program.  And since register 15 is the standard IBM program linkage "return code" register, the return code passed back to the calling program is always 0.

If the calling program is an application program which calls IEFBR14 according to standard IBM program linkage conventions, then IEFBR14 acts as a subroutine which immediately returns to the calling program and always passes back a return code of 0.  In other words, it functions as a subroutine "stub" which can be useful in some testing situations.


If IEFBR14 is executed as a standalone batch program; i.e.,

//JS10   EXEC PGM=IEFBR14

then it provides a convenient way to insert a job step into a given job which is guaranteed to set a return code of zero.  This job step can also be used to catalog or delete specified data sets from within a batch job.

The following JCL for the job named MUKESH1 accomplishes several tasks, even though IEFBR14 does nothing but return 0:

//MUKESH1 JOB 1,LEO,MSGCLASS=X
//EXEC1       EXEC PGM=IEFBR14//NEWDS DD DSN=MUKESH.LIB.CNTL,DISP=(NEW,CATLG),VOL=SER=WORK02,//         UNIT=3390,SPACE=(CYL,(3,1,25)
//OLDDS DD DSN=MUKESH.OLD.DATA,DISP=(OLD,DELETE)

The z/OS job scheduler to check your JCL statements for syntax errors.
The initiator allocates the new data set defined by NEWDS (MUKESH.LIB.CNTL) and keeps the data set when the job ends.
The initiator also deletes an old data set defined by OLDDS (MUKESH.OLD.DATA) at the end of the job.