Performing Tasks


Creating a Backup Copy -


IEBGENER is used to create a backup copy of a sequential data set or PDS or PDSE member.

Example -

Scenario - Create flat (PS) file backup.

Input PS File - MATEPK.IEBGENER.INPUTPS

----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
********************************* Top of Data **********************************
E0001    EMPLOYEE1           DIR                 LOC1      0000100000    
E0002    EMPLOYEE2           MGR       DEPT1     LOC1      0000080000    
E0003    EMPLOYEE3           MGR       DEPT2     LOC2      0000075000    
E0004    EMPLOYEE4           TL        DEPT1     LOC1      0000050000    
E0005    EMPLOYEE5           SSE       DEPT1     LOC1      0000045000    
E0006    EMPLOYEE6           SE        DEPT1     LOC1      0000034000    
E0007    EMPLOYEE7           SSE       DEPT2     LOC2      0000046000    
******************************** Bottom of Data ********************************

Code -

----+----1----+----2----+----3----+----4----+----5----+----6
//MATEPKC  JOB (123),'MTH',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),
//             NOTIFY=&SYSUID
//***********************************************************
//* CREATE A BACKUP OF FLAT FILE
//***********************************************************
//STEP10   EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSUT1   DD DSN=MATEPK.IEBGENER.INPUTPS,DISP=SHR
//SYSUT2   DD DSN=MATEPK.IEBGENER.BACKUPPS,
//            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  DUMMY

Output - MATEPK.IEBGENER.BACKUPPS

VIEW       MATEPK.IEBGENER.BACKUPPS                        Columns 00001 00072 
Command ===>                                                  Scroll ===> CSR  
=COLS> ----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
****** ***************************** Top of Data ******************************
000100 E0001    EMPLOYEE1           DIR                 LOC1      0000100000   
000200 E0002    EMPLOYEE2           MGR       DEPT1     LOC1      0000080000   
000300 E0003    EMPLOYEE3           MGR       DEPT2     LOC2      0000075000   
000400 E0004    EMPLOYEE4           TL        DEPT1     LOC1      0000050000   
000500 E0005    EMPLOYEE5           SSE       DEPT1     LOC1      0000045000   
000600 E0006    EMPLOYEE6           SE        DEPT1     LOC1      0000034000   
000700 E0007    EMPLOYEE7           SSE       DEPT2     LOC2      0000046000   
****** **************************** Bottom of Data ****************************

Explaining Example -

  • SYSUT1 DD maps the input data set (MATEPK.IEBGENER.INPUTPS).
  • SYSUT2 DD defines the output flat file (MATEPK.IEBGENER.BACKUPPS).
  • SYSIN DD defines the control data set as DUMMY to specify no control statements are using.

Creating a PDS or PDSE from Sequential File Input -


IEBGENER can logically divide a sequential file into record groups and assign member names to the record groups.

Example -

Scenario - Create PDS member from PS file.

Input PS File - MATEPK.IEBGENER.INPUTPS

----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
********************************* Top of Data **********************************
E0001    EMPLOYEE1           DIR                 LOC1      0000100000    
E0002    EMPLOYEE2           MGR       DEPT1     LOC1      0000080000    
E0003    EMPLOYEE3           MGR       DEPT2     LOC2      0000075000    
E0004    EMPLOYEE4           TL        DEPT1     LOC1      0000050000    
E0005    EMPLOYEE5           SSE       DEPT1     LOC1      0000045000    
E0006    EMPLOYEE6           SE        DEPT1     LOC1      0000034000    
E0007    EMPLOYEE7           SSE       DEPT2     LOC2      0000046000    
******************************** Bottom of Data ********************************

Code -

----+----1----+----2----+----3----+----4----+----5----+----6
//MATEPKC  JOB (123),'MTH',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),
//             NOTIFY=&SYSUID
//***********************************************************
//* COPY FALT FILE DATA INTO THE NEW MEMBER OF NEW PDS       
//***********************************************************
//STEP10   EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSUT1   DD DSN=MATEPK.IEBGENER.INPUTPS,DISP=SHR
//SYSUT2   DD DSN=MATEPK.IEBGENER.NEWPDS(BACKUPPS),
//            DISP=(NEW,CATLG,DELETE),
//            SPACE=(TRK,(10,10),RLSE),
//            UNIT=3390,VOL=SER=DEVHD4,DSNTYPE=LIBRARY,
//            DCB=(DSORG=PO,RECFM=FB,LRECL=80,BLKSIZE=800)
//SYSIN    DD  DUMMY

Output - MATEPK.IEBGENER.OUTPDS(BACKUPPS)

VIEW       MATEPK.IEBGENER.NEWPDS(BACKUPPS) - 01.00        Columns 00001 00072 
Command ===>                                                  Scroll ===> CSR  
=COLS> ----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
****** ***************************** Top of Data ******************************
000001 E0001    EMPLOYEE1           DIR                 LOC1      0000100000   
000002 E0002    EMPLOYEE2           MGR       DEPT1     LOC1      0000080000   
000003 E0003    EMPLOYEE3           MGR       DEPT2     LOC2      0000075000   
000004 E0004    EMPLOYEE4           TL        DEPT1     LOC1      0000050000   
000005 E0005    EMPLOYEE5           SSE       DEPT1     LOC1      0000045000   
000006 E0006    EMPLOYEE6           SE        DEPT1     LOC1      0000034000   
000007 E0007    EMPLOYEE7           SSE       DEPT2     LOC2      0000046000   
****** **************************** Bottom of Data ****************************

Explaining Example -

  • SYSUT1 DD maps the input data set (MATEPK.IEBGENER.INPUTPS).
  • SYSUT2 DD specifies the output file as PDS member MATEPK.IEBGENER.NEWPDS(BACKUPPS). MATEPK.IEBGENER.NEWPDS and BACKUPPS are the newly created in this job.
  • SYSIN DD Specifies the control data set as DUMMY to identify no control statements are used.

Adding Members to a PDS or PDSE -


IEBGENER can creates the members from sequential file input and adds them to the data set.

Example -

Scenario - Create a new member in the existing PDS from PS file.

Input PS File - MATEPK.IEBGENER.INPUTPS

----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
********************************* Top of Data **********************************
E0001    EMPLOYEE1           DIR                 LOC1      0000100000    
E0002    EMPLOYEE2           MGR       DEPT1     LOC1      0000080000    
E0003    EMPLOYEE3           MGR       DEPT2     LOC2      0000075000    
E0004    EMPLOYEE4           TL        DEPT1     LOC1      0000050000    
E0005    EMPLOYEE5           SSE       DEPT1     LOC1      0000045000    
E0006    EMPLOYEE6           SE        DEPT1     LOC1      0000034000    
E0007    EMPLOYEE7           SSE       DEPT2     LOC2      0000046000    
******************************** Bottom of Data ********************************

Code -

----+----1----+----2----+----3----+----4----+----5----+----6
//MATEPKC  JOB (123),'MTH',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),
//             NOTIFY=&SYSUID
//***********************************************************
//* COPY FLAT FILE DATA INTO THE NEW MEMBER OF EXISTING PDS
//***********************************************************
//STEP10   EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSUT1   DD DSN=MATEPK.IEBGENER.INPUTPS,DISP=SHR
//SYSUT2   DD DSN=MATEPK.IEBGENER.OUTPDS(BACKUPPS),DISP=OLD
//SYSIN    DD  DUMMY

Output - MATEPK.IEBGENER.OUTPDS(BACKUPPS)

VIEW       MATEPK.IEBGENER.OUTPDS(BACKUPPS) - 01.00      Columns 00001 00072 
Command ===>                                                  Scroll ===> CSR  
=COLS> ----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
****** ***************************** Top of Data ******************************
000001 E0001    EMPLOYEE1           DIR                 LOC1      0000100000   
000002 E0002    EMPLOYEE2           MGR       DEPT1     LOC1      0000080000   
000003 E0003    EMPLOYEE3           MGR       DEPT2     LOC2      0000075000   
000004 E0004    EMPLOYEE4           TL        DEPT1     LOC1      0000050000   
000005 E0005    EMPLOYEE5           SSE       DEPT1     LOC1      0000045000   
000006 E0006    EMPLOYEE6           SE        DEPT1     LOC1      0000034000   
000007 E0007    EMPLOYEE7           SSE       DEPT2     LOC2      0000046000   
****** **************************** Bottom of Data ****************************

Explaining Example -

  • SYSUT1 DD maps the input data set (MATEPK.IEBGENER.INPUTPS).
  • SYSUT2 DD specifies the output file as PDS member MATEPK.IEBGENER.OUTPDS(BACKUPPS). MATEPK.IEBGENER.OUTPDS is an existing PDS and BACKUPPS is the newly created member in this job.
  • SYSIN DD Specifies the control data set as DUMMY to identify no control statements are used.

Changing Logical Record Length -


IEBGENER is used to produce a output data set that can contain either fixed-length or variable-length records with a logical record length different from the input logical record length.

Example -

Scenario - Create new PS with different length from input PS file.

Input PS File - MATEPK.IEBGENER.INPUTPS

----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
********************************* Top of Data **********************************
E0001    EMPLOYEE1           DIR                 LOC1      0000100000    
E0002    EMPLOYEE2           MGR       DEPT1     LOC1      0000080000    
E0003    EMPLOYEE3           MGR       DEPT2     LOC2      0000075000    
E0004    EMPLOYEE4           TL        DEPT1     LOC1      0000050000    
E0005    EMPLOYEE5           SSE       DEPT1     LOC1      0000045000    
E0006    EMPLOYEE6           SE        DEPT1     LOC1      0000034000    
E0007    EMPLOYEE7           SSE       DEPT2     LOC2      0000046000    
******************************** Bottom of Data ********************************

Code -

----+----1----+----2----+----3----+----4----+----5----+----6
//MATEPKP  JOB (123),'MTH',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),
//             NOTIFY=&SYSUID
//***********************************************************
//* COPY INPUT PS DATA TO NEW PS FILE BY CHANGING LENGTH
//***********************************************************
//STEP10   EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSUT1   DD DSN=MATEPK.IEBGENER.INPUTPS,DISP=SHR
//SYSUT2   DD DSN=MATEPK.IEBGENER.OUTPUT1,
//            DISP=(NEW,CATLG,DELETE),
//            SPACE=(TRK,(10,10),RLSE),
//            UNIT=3390,VOL=SER=DEVHD4,
//            DCB=(DSORG=PS,RECFM=FB,LRECL=70,BLKSIZE=700)
//SYSIN    DD  *
  GENERATE MAXFLDS=1
    RECORD FIELD=(70,1,,1)
/*

Output - MATEPK.IEBGENER.OUTPUT1

VIEW       MATEPK.IEBGENER.OUTPUT1                         Columns 00001 00070 
Command ===>                                                  Scroll ===> CSR  
=COLS> ----+----1----+----2----+----3----+----4----+----5----+----6----+----7  
****** ***************************** Top of Data ******************************
000001 E0001    EMPLOYEE1           DIR                 LOC1      0000100000   
000002 E0002    EMPLOYEE2           MGR       DEPT1     LOC1      0000080000   
000003 E0003    EMPLOYEE3           MGR       DEPT2     LOC2      0000075000   
000004 E0004    EMPLOYEE4           TL        DEPT1     LOC1      0000050000   
000005 E0005    EMPLOYEE5           SSE       DEPT1     LOC1      0000045000   
000006 E0006    EMPLOYEE6           SE        DEPT1     LOC1      0000034000   
000007 E0007    EMPLOYEE7           SSE       DEPT2     LOC2      0000046000   
****** **************************** Bottom of Data ****************************

Explaining Example -

  • SYSUT1 DD maps the input data set (MATEPK.IEBGENER.INPUTPS).
  • SYSUT2 DD specifies the output file MATEPK.IEBGENER.OUTPUT1 with record length 70.
  • SYSIN DD specifies the control data set as DUMMY to identify no control statements are used.

Creating an Edited Data Set -


IEBGENER can specify editing information that applies to a record, a group of records, selected groups of records, or an entire data set.

Below are scenarios when the edited dataset is created -

  • Rearranging or ignoring data fields within a record.
  • Supplying literal information as replacement data.
  • Converting data from one format to another.

Example -

Scenario - Create new PS with different 40 length and copy data(1-29 bytes and 60-70 bytes) from PDS member.

Input PS File - MATEPK.IEBGENER.NEWPDS(BACKUPPS)

----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
********************************* Top of Data **********************************
E0001    EMPLOYEE1           DIR                 LOC1      0000100000   
E0002    EMPLOYEE2           MGR       DEPT1     LOC1      0000080000   
E0003    EMPLOYEE3           MGR       DEPT2     LOC2      0000075000   
E0004    EMPLOYEE4           TL        DEPT1     LOC1      0000050000   
E0005    EMPLOYEE5           SSE       DEPT1     LOC1      0000045000   
E0006    EMPLOYEE6           SE        DEPT1     LOC1      0000034000   
E0007    EMPLOYEE7           SSE       DEPT2     LOC2      0000046000   
******************************** Bottom of Data ********************************

Code -

----+----1----+----2----+----3----+----4----+----5----+----6----+
//MATEPKC  JOB (123),'MTH',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),
//             NOTIFY=&SYSUID
//************************************************************
//* COPY PDS MEMBER DATA TO PS WITH EMPNO, EMPNAME AND SALARY
//************************************************************
//STEP10   EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSUT1   DD DSN=MATEPK.IEBGENER.NEWPDS(BACKUPPS),DISP=SHR
//SYSUT2   DD DSN=MATEPK.IEBGENER.OPDS2,
//            DISP=(NEW,CATLG,DELETE),
//            SPACE=(TRK,(10,10),RLSE),
//            UNIT=3390,VOL=SER=DEVHD4,
//            DCB=(DSORG=PS,RECFM=FB,LRECL=40,BLKSIZE=400)
//SYSIN    DD  *
  GENERATE MAXFLDS=2,MAXGPS=1
    RECORD FIELD=(29,1,,1),
           FIELD=(10,60,,30)
    RECORD IDENT=(5,'E0005',1)
/*

Output - MATEPK.IEBGENER.OUTPUT1

VIEW       MATEPK.IEBGENER.OPDS2                           Columns 00001 00040 
Command ===>                                                  Scroll ===> CSR  
=COLS> ----+----1----+----2----+----3----+----4                                
****** ***************************** Top of Data ******************************
000001 E0001    EMPLOYEE1           0000100000                                 
000002 E0002    EMPLOYEE2           0000080000                                 
000003 E0003    EMPLOYEE3           0000075000                                 
000004 E0004    EMPLOYEE4           0000050000                                 
000005 E0005    EMPLOYEE5           0000045000                                 
****** **************************** Bottom of Data ****************************

Explaining Example -

  • SYSUT1 DD maps the input data set (MATEPK.IEBGENER.INPUTPS).
  • SYSUT2 DD specifies the output file MATEPK.IEBGENER.OUTPUT1 with record length 70.
  • SYSIN DD specifies the control data set as DUMMY to identify no control statements are used.
  • GENERATE MAXFLDS=2,MAXGPS=1 indicates a maximum of two fields and 1 INDENT uses in subsequent control statements.
  • RECORD FIELD=(29,1,,1) specifies 1-29 bytes should place from the 1st byte in output file.
  • FIELD=(10,60,,30) specifies 60-70 bytes should place from the 30th byte in output file.
  • RECORD IDENT=(5,'E0005',1) specifies copy upto the record having 'E0005' in the 1-5 positions.