Let's understand Mainframe
Home Tutorials Interview Q&A Quiz Mainframe Memes Contact us About us

Module 6: JCL Utilities


IEHPROGM

The following are the use of the IEHPROGM utility together with the SYSIN Card which can be used to accomplish the corresponding features:-

  • To catalog data sets.
    • SYSIN CARD:-
      CATLG DSNAME=data.set.name, VOL=device-name=volume-serial-number
  • To uncatalog data sets.
    • SYSIN CARD:-
      UNCATLG DSNAME=data.set.name
  • To rename data sets.
    • SYSIN CARD:-
      RENAME DSNAME=data.set.name, VOL=device-name=volume-serial-number, NEWNAME=new.data.set.name
  • To create an index of GDG
    • SYSIN CARD:-
      BLDG INDEX=gdg-name, ENTRIES=n, [EMPTY], [DELETE]
    • Parameters specified above in box bracket are optional
    • ENTRIES is used to specify maximum number of generations that can exist for that GDG
    • EMPTY is used to specify that all entries are to be removed from the index, if limit of number of generations is reached
    • DELETE keyword is used to specify that the generation data sets are to be physically removed from volume that they exist on, if their entries are deleted from the index
  • To delete an index of GDG
    • SYSIN CARD:-
      BLDG INDEX=gdg-index-name

To catalog data sets.

//STEPNAME EXEC PGM=IEHPROGM //SYSPRINT DD SYSOUT=* //SYSUT1 DD UNIT=PROD, // VOL=SER=FICH01 //SYSUT2 DD UNIT=UNIT5, // VOL=SER=1234 //SYSIN DD * CATLG DSNAME=DEPT.FILE, VOL=UNIT5=1234 /* //

  • In above example, IEHPROGM utility is used to catalog dataset. In SYSUT1, the characteristic of permanently mounted direct access volume is specified. In SYSUT2, the location of data set that is to be cataloged is identified.
  • CATLG statement specifies that DEPT.FILE, which resides on volume called 1234 of device UNIT5, is cataloged.

To uncatalog data sets.

//STEPNAME EXEC PGM=IEHPROGM //SYSPRINT DD SYSOUT=* //SYSUT1 DD UNIT=PROD, // VOL=SER=FICH01 //SYSIN DD * UNCATLG DSNAME=DEPT.FILE /* //

  • UNCATLG statement specifies that data set ‘DEPT.FILE’ needs to be removed from System catalog.

To rename data sets.

//STEPNAME EXEC PGM=IEHPROGM //SYSPRINT DD SYSOUT=* //SYSUT1 DD UNIT=PROD, // VOL=SER=FICH01 //SYSUT2 DD UNIT=UNIT5, // VOL=SER=1234 //SYSIN DD * RENAME DSNAME=DEPT.FILE, VOL=UNIT5=1234, NEWNAME=DEPT.FILE.NEW /* //

  • RENAME statement specifies that data set with current name ‘DEPT.FILE’ residing on volume 1234 of device UNIT5 is to be renamed to ‘DEPT.FILE.NEW’

To create and index of GDG.

//STEPNAME EXEC PGM=IEHPROGM //SYSPRINT DD SYSOUT=* //SYSUT1 DD UNIT=PROD, // VOL=SER=FICH01 //SYSIN DD * BLDG INDEX=DEPT.RECORDS.YEARLY, ENTRIES=10, DELETE /* //

  • BLDG statement specifies that an index for GDG namely ‘DEPT.RECORDS.YEARLY’ will be created. ENTRIES is set to 10, which means maximum 10 generations will be maintained.
  • DELETE keyword indicates that when the limit of 10 is reached then the earliest data set should be physically deleted i.e. when 11th generation is created the oldest one (1st generation) will be deleted.
  • When we specify EMPTY keyword, all the generations are deleted when maximum limit is reached i.e. when 11th generation is created, all of the older generations from 1 to 10 will be deleted.

To delete an index of GDG.

//STEPNAME EXEC PGM=IEHPROGM //SYSPRINT DD SYSOUT=* //SYSUT1 DD UNIT=PROD, // VOL=SER=FICH01 //SYSIN DD * DLTX INDEX=DEPT.RECORDS.YEARLY /* //

  • DLTX INDEX command will delete GDG index ‘DEPT.RECORDS.YEARLY’ along with all its generation data sets.






© copyright mainframebug.com
Privacy Policy