Showing posts with label iebgener utility. Show all posts
Showing posts with label iebgener utility. Show all posts

Saturday, 10 August 2013

JCL IEBGENER Utility | IEBGENER Examples | IEBGENER VS IEBCOPY | IEBGENER Utility in JCL [JCL Utilities].

IEBGENER Utility in JCL, iebgener examples, iebgener in mainframe,

IEBGENER Utility in JCL.

IEBGENER Utility in JCL is an easy way to copy, print, and create non-VSAM datasets. The IEBGENER utility is used to copy multiple files or copy a single file. In this session, you'll learn the basics of the IEBGENER utility, followed by IEBGENER DD control statements and the IEBGENER SYSIN control statements. To reinforce your understanding, I will walk you through the IEBGENER examples. Let's get started with an introduction to the IEBGENER utility. 

IEBGENER Utility Tutorial - Agenda. 

  • Introduction. 
  • IEBGENER DD Statements/IEBGENER SYSIN Statements.
  • IEBGENER Vs IEBCOPY utility.
  • IEBGENER Examples.
  • IEBGENER in JCL - YouTube video.
  • Conclusion.

Introduction.

Let's try to answer or let's try to understand what is JCL utility or what do you understand by the term utility. In layman terms, mainframe utility programs or just utilities are the programs that can be used for common data processing functions like copying or printing a data set these utilities are supplied with IBM z/OS and they're widely used in batch jobs now let's talk about IEBGENER utility.

What is the IEBGENER Utility in JCL?


IEBGENER Utility

IBM IEBGENER Utility.

IEBGENER utility in JCL, it is a popular mainframe utility. IEBGENER utility is a copy program that has been a part of the operating system since the first release of OS/360 and one of its many uses is to copy a sequential data set a member of partition data set (i.e. PDS) or PDSE or probably z/OS Unix system services files such as HFS files.
  
As a result, the IEBGENER utility is used can be used to backup or restore sequential data sets you can also use this utility to print a non-VSAM sequential data set by copying it to an SYSOUT data set. Finally, the common use of IEBGENER utility is to create, reformat, and backup non-VSAM sequential data sets

You can use IEBGENER to perform the following daily tasks:
  • IEBGENER utility in the JCL is used to create a backup of the sequential data set.
  • IEBGENER utility can be used to print a non-VSAM sequential data set.
  • IEBGENER utility can be used to rearrange fields and convert their data formats. 
  • IEBGENER utility can amplify an existing partitioned data set (PDS).
  • IEBGENER utility can change or re-block the data set record logical length. Copy user labels on sequential output data sets. 
The following figure, explains the process of creating partitioned data set from sequential data et. The sequential dataset is represented by the left section of the figure.

The IEBGENER utility statement is used to split a sequential dataset into logical record groups. Finally, the right section of the fig represents a partitioned data set.


IBM utility, IEBGENER Utility in JCL, JCL IEBGENER

IEBGENER Utility Creating PDS sequential data set.

                                    

IEBGENER DD Statements and IEBGENER SYSIN control statements

Now, let's try to understand what are the different DD statements that are required by an IEBGENER utility. There are four different DD statements that are required by an IEBGENER utility.

iebgener in mainframe, iebgener sysin control statements, jcl iebgener

JCL IEBGENER Utility DD Statement.


  • SYSUT1 - it's used to specify the input file.
  • SYSUT2 - it's used to specify the output file.
  • SYSPRINT - it's an output message file.
  • SYSIN - it's used to specify the control parameters.
Important point - If you do not want to use a control statement the SYSIN DD statement is still required. You must code it as a dummy data set.

What is the difference between IEBGENER utility and IEBCOPY utility (iebgener vs iebcopy)?

Well, the correct answer is that both utilities are used for data processing. However, the IEBGENER utility is used for the non-VSAM sequential data sets. It's used to copy, create print or reformat data set as you copy.

IEBCOPY utility in the JCL is primarily used to perform the operation on a personal data set (PDS) or PSDE. It's used to copy, merge, compress, or archive a PDS into a sequential file. 

IEBGENER Example - Sample JCL to invoke the IEBGENER utility (iebgener syntax). 

//RXTC02T JOB ... (JOB CARD)
//STEP1    EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSUT1   DD DSNAME=RC.EMP.SAL.FILE,DISP=SHR
//SYSUT2   DD DSNAME=RC.EMP.SAL.FILE.BKP,DISP=OLD
//SYSIN    DD DUMMY
/*

Now, let's go through IEBGENER Examples.

The following IEBGENER JCL example illustrates the use of the IEBGENER utility to copy multiple files or to copy PDS members. Let's discuss each step one by one.  

//TPRCK99A JOB 'TOPICTRICK',MSGCLASS=A,CLASS=C,
//             MSGLEVEL=(1,1),NOTIFY=&SYSUID
//*
//* PROJECT DESC:: SAMPLE JCL TO INVOKE IEBGENER UTILITY.
//* :: IEBGENER Examples.
//*
//* STEP01  :: IEBGENER Utility to backup dataset.
//*
//STEP01 EXEC PGM=IEBGENER
//SYSUT1   DD DSN=Z03130.INPUT.FILE,DISP=SHR
//SYSUT2   DD DSN=Z03130.INPUT.FILE.BKP,DISP=(NEW,CATLG),
//            UNIT=SYSDA,SPACE=(CYL,(5,1))
//SYSPRINT DD SYSOUT=*
//SYSIN    DD DUMMY
//*
//* STEP02 - IEBGENER example to Print Dataset .
//*
//STEP02 EXEC PGM=IEBGENER
//SYSUT1   DD DSN=Z03130.INPUT.FILE,DISP=SHR
//SYSUT2   DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSIN    DD DUMMY
//*
//* STEP03 - IEBGENER Utility example to Copy PDS member data.
//*
//STEP03 EXEC PGM=IEBGENER
//SYSUT1   DD DSN=Z03130.PDS.REXX(REXX001),DISP=SHR
//SYSUT2   DD DSN=Z03130.PDS.REXX.BKP(REXBKP),DISP=(OLD)
//SYSPRINT DD SYSOUT=*
//SYSIN    DD DUMMY
//*
//* STEP04 - IEBGENER example to Reformat data while copying the data.
//* - How to use IEBGENER Generate and Record field.
//*
//STEP04 EXEC PGM=IEBGENER
//SYSUT1   DD DSN=Z03130.INPUT.FILE,DISP=SHR
//SYSUT2   DD DSN=Z03130.INPUT.FILE.BKP,DISP=OLD
//SYSPRINT DD SYSOUT=*
//SYSIN    DD *
  GENERATE MAXFLDS=11,MAXLITS=10
  RECORD FIELD=(23,1,,1),FIELD=(8,'EMP SAL-',,24),                     X
         FIELD=(4,24,,32)
/*
//
Created with Artisteer


IEBGENER utility in JCL - YouTube Video.




Conclusion. 

Finally, this marks an end to the JCL IEBGENER Utility tutorial (JCL Utility). In this tutorial, you learn the basics of IEBGENER utility and the use of IEBGENER utility. Also, you learned how to use the IEBGENER utility in JCL. Do check out COBOL LEVEL 88 Condition.


Subscribe to Topictrick & Don't forget to press THE BELL ICON to never miss any updates. Also, Please visit mention the link below to stay connected with Topictrick and the Mainframe forum on - 

► Youtube
► Facebook 
► Reddit

Thank you for your support. 
Mainframe Forum™

Sunday, 4 August 2013

IEBGENER Utility || IEBGENER Utility Examples || IEBGENER Utility in Mainframe.

iebgener jcl examples
IEBGENER Utility


The IEBGENER utility can be used to copy non-VSAM sequential data sets to or from tape or DASD. As a result, this utility can be used to back up and restore sequential data sets.

  • You can also use this utility to print a non-VSAM sequential data set by copying it to a SYSOUT data set. Although the printed output isn’t formatted, this is a quick way to list the contents of the records in a data set.
  • You can use the SYSIN data set to provide control statements that can rearrange fields and convert their data formats.
  • SYSIN DD statement is required with DUMMY data set is required in-case you skip control statements. 
The DD statements required by the IEBGENER utility.

DD Name
Description
SYSPRINT
Output messages or printed output.
SYSUT1
The input file.
SYSUT2
The output file.
SYSIN
The control statement file.

Example 1: A job step that uses IEBGENER to copy a sequential file.

//RXTRX2T JOB ... (JOB CARD)
//STEP020  EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSUT1   DD DSNAME=RC01.PAYMAST,DISP=SHR
//SYSUT2   DD DSNAME=RC01.PAYTMAST.BACKUP,
//            DISP=(NEW,CATLG,DEL),UNIT=SYSDA,
//            SPACE=(CYL,(1,1))
//SYSIN    DD DUMMY

Example 2:  A job step that uses IEBGENER to print a sequential file.

//RXTT02T JOB ... (JOB CARD)
//STEP30   EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSUT1   DD DSNAME=RC01.CUST.DETS.FILE,DISP=SHR
//SYSUT2   DD SYSOUT=*
//SYSIN    DD DUMMY    

If you want to rearrange or convert data formats as you copy a data set, you can use the GENERATE and RECORD control statements.

If you increase or decrease the size of the output record, you should code the DCB parameter in the DD statement for the output file with the new length in the LRECL sub parameter.

The syntax of the GENERATE control statement

                GENERATE MAXFLDS=n,
                                     [ ,MAXLITS=n ] 

Parameter
Description
MAXFLDS
The number of field parameters in RECORD statements.
MAXLITS
The number of bytes of literal data included in the field parameters in RECORD statements.

The syntax of the RECORD control statement

                   RECORD   FIELD=(length, in-loc | 'literal', conv, out-loc])
                   [,FIELD=(length, in-loc |'literal', conv, out-loc) ]…

Parameter
Description
 length
The length of the field in the input record.
 in-loc
The input record start with default position i.e. 1st position.
 literal
Used instead of in-loc to supply a literal value to the output field.
 conv
The conversion operation to be performed on the field. Specify XE to  convert to hexadecimal, PZ to convert from packed-decimal to zoned-decimal, and ZP to convert from zoned-decimal to packed-decimal. If omitted, no conversion is done.
 out-loc
The starting position of the field in the output record. The default is 1.


Example : 2 IEBGENER to copy a sequential file with reformatting.

//RXT002T JOB ... (JOB CARD)
//STEP01   EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSUT1   DD DSNAME=RC01.CUST.MAST.FILE,DISP=SHR
//SYSUT2   DD DSNAME=RC01.CUST.MAST.TEST.FILE,
//            DISP=(NEW,CATLG,DEL),
//            UNIT=SYSDA,SPACE=(CYL,(1,1)),
//            DCB=(RECFM=FB,LRECL=40,BLKSIZE=800)
//SYSIN DD *
  GENERATE MAXFLDS=5,MAXLITS=4
  RECORD FIELD=(5,1,,1),FIELD=(20,21,,6), -
  FIELD=(9,61,ZP,26),                     -
  FIELD=(9,70,ZP,31),                     -
  FIELD=(4,'TEST',,36)
/*


Please share and subscribe to my blog for more such post and don't forget to share your feedback. 

Created with Artisteer

New In-feed ads