Useful DFSMShsm User Commands

The following is a list of useful DFSMShsm user commands, containing their description, syntax and some examples.

CommandDescription
HALTERDS
HAL
Changes the data set parameters that affect backup. This command only applies to NON-SMS managed data sets. 

Syntax:    
HALTERDS (dsname/password…)
              FREQUENCY(days) or SYSFREQUENCY
              VERSIONS(limit) or SYSVERSIONS 

Examples:
HALTERDS PARTSTST.CNTL  VERSIONS(13) FREQUENCY(999)
HALTERDS COMTEST.CLIST  SYSVERSIONS
HALTERDS VERSION1.TEXT  FREQUENCY(10)  
HBACKDS
HBACK
Backs up a specific data set. 

Syntax:    
HBACKDS (dsname/password…)
             NEWNAME(newdatasetname)
               DATE(yyyy/mm/dd)
                 TIME(hhmmss)
               SPHERE(YES ! NO)
               GENVSAMCOMPNAMES(YES ! NO)
             EXTENDRC
             VOLUME(volid) UNIT(unittype)
             CHANGEDONLY
             TARGET (DASD ! TAPE)
             CC ( STANDARD ! PREFERRED ! REQUIRED
                  PHYSICALEND ! LOGICALEND )
             RETAINDAYS(days)
             WAIT or NOWAIT 

Examples:
HBACKDS MSTLEVEL.LINKLIST/WRITE VOLUME(GPAVU1) UNIT(3330) –               
WAIT EXTENDRC
HBACKDS LEVELMST.OUTLIST TARGET(TAPE) NOWAIT 
HBDELETE
HBDEL
Deletes a backup version of a data set. 

Syntax:    
HBDELETE (dsname/password…)
              FROMVOLUME(volid)
              VERSIONS(bvn…)
              DATE(yyyy/mm/dd) TIME(hhmmss)
              ALL 

Examples:
HBDELETE CMD.CLIST
HBDELETE MATRIX.TEXT FROMVOLUME(VOL001) VERSIONS(2,3,10)  
HCANCEL
HCAN
Cancels an existing queued request. Unless you are a DFSMShsm authorised user, you may only cancel requests submitted by your own userid.

Syntax:    
HCANCEL
              DATASETNAME(dsn)
              REQUEST(number)
              USERID(userid) 

Examples:
HCANCEL DATASETNAME(‘A999999.CLIST.CLIST’)
HCANCEL DATASETNAME(CLIST.CLIST)
HCANCEL REQUEST(9999)HCANCEL USERID(A999999) 
HDELETE
HDEL
Deletes a migrated data set on a level 1 or level 2 volume. You cannot delete datasets from primary volumes or backup volumes with this command. 

Syntax:    
HDELETE (dsname/password….)
             EXTENDRC
             PURGE
             WAIT or NOWAIT 

Examples:
HDELETE  TEXTVER1.TEXT  PURGE WAIT EXTENDRC
HDELETE  CCEL.*.LOADLIST
HDELETE (VER1TEXT.LIST,CLCE.BASICTST.VSBASIC) 
HLIST
HL
Lists information from the migration and backup control data sets. 

Syntax:    
HLIST MIGRATIONVOLUME or MIGRATIONLEVEL1 or  MIGRATIONLEVEL2
          or MIGRATIONLEVEL2(DASD) or MIGRATIONLEVEL2(TAPE)
           or PRIMARYVOLUME or VOLUME or VOLUME(volid)
                 BACKUPCONTROLDATASET or MIGRATIONCONTROLDATASET
                 or BOTH
                 OUTDATASET(dsname) or SYSOUT or SYSOUT(class)
                 or TERMINAL     

HLIST BACKUPVOLUME or BACKUPVOLUME(volid)
                 OUTDATASET(dsname) or SYSOUT or SYSOUT(class)
                 or TERMINAL

HLIST USER or USER(userid)
                 OUTDATASET(dsname) or SYSOUT or SYSOUT(class)
                 or TERMINAL     

HLIST DATASETNAME or DATASETNAME(dsname) or LEVEL
                 or LEVEL(qualifier)
                 BACKUPCONTROLDATASET or MIGRATIONCONTROLDATASET
                 or BOTH
                 INCLUDEPRIMARY
                 OUTDATASET(dsname) or SYSOUT or SYSOUT(class)
                 or TERMINAL
                 SELECT(AGE(mindays) or AGE(mindays maxdays)
                        MIGRATIONLEVEL1 or MIGRATIONLEVEL2
                        or VOLUME(volser)
                        RETAINDAYS or ACTIVE
                        SMALLDATASETPACKING or NOSMALLDATASETPACKING
                        VSAM)

Examples:
HLIST LEVEL(MST7707) MIGRATIONCONTROLDATASET TERMINAL
HLIST LEVEL(MST7707.A) BACKUPCONTROLDATASET SYSOUT(A)
HLIST
HLIST DATASETNAME BOTH SELECT(AGE(0 60)) ODS(‘CECL.OUT.HLIST’)
HLIST LEVEL(MST7707) SELECT(VOLUME(MVL003) SDSP) SYSOUT(A) 
HMIGRATE
HMIG
Migrates a specific data set. 

Syntax:    
HMIGRATE (dsname/password…)
              EXTENDRC
              MIGRATIONLEVEL2
              WAIT or NOWAIT 

Examples:
HMIGRATE TEXTVER3.TEXT/WRITE WAIT EXTENDRC
HMIGRATE GRPA.*.OUTLIST MIGRATIONLEVEL2 NOWAIT
HMIGRATE (VER3.TEXT/WRITE APG.LOAD/WRITE) ML2 
HQUERY
HQ
Lists DFSMShsm requests. 

Syntax:    
HQUERY
             DATASETNAMES(dsname …)
             REQUESTS or REQUESTS(reqnum …) 

Examples:
HQUERY
HQUERY DATASETNAMES(OUTTESTS.TESTLIST)
HQUERY REQUESTS(25,27,28) 
HRECALL
HRECA
Recalls a specific data set. 

Syntax:    
HRECALL (dsname/password…)
             EXTENDRC
             VOLUME(volid) UNIT(unittype)
             WAIT or NOWAIT 

Examples:
HRECALL COMM.CLIST/LK1 VOLUME(VOL005)  UNIT(3330-1) WAIT EXTENDRC
HRECALL (TEXTVER3.TEXT  VER1TEXT.LIST ) WAIT
HRECALL  ELMST.*.TEXT  NOWAIT  
HRECOVER
HRECOV
Recovers a backup version of a data set. 

Syntax:    
HRECOVER (dsname/password…)
              EXTENDRC
              FROMVOLUME(volid)
              GENERATION(gennum) or DATE(date) TIME(time) or VERSION(ver
              NEWNAME(newdsname/password)
              REPLACE
              TOVOLUME(volid) UNIT(unittype)
              WAIT or NOWAIT 

Examples:
HRECOVER PARTSTST.CNTL TOVOLUME(VOL007) UNIT(3350) REPLACE
HRECOVER OUTTESTS.TESTLIST GENERATION(2) WAIT EXTENDRC 

For more information on DFSMShsm visit the IBM Knowledge Center and look for the ‘z/OS DFSMShsm’ library collection.

2 Comments

  1. Very useful.

    Long format and short format are concatenated in the page,. Please fix.

Leave a Reply

Your email address will not be published.


*


This site uses Akismet to reduce spam. Learn how your comment data is processed.