Useful DFSMShsm User Commands

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

CommandDescription
HALTERDSHALChanges 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)  
HBACKDSHBACKBacks 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 
HBDELETEHBDELDeletes 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)  
HCANCELHCANCancels 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) 
HDELETEHDELDeletes 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) 
HLISTHLLists 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) 
HMIGRATEHMIGMigrates 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 
HQUERYHQLists DFSMShsm requests. 

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

Examples:
HQUERY
HQUERY DATASETNAMES(OUTTESTS.TESTLIST)
HQUERY REQUESTS(25,27,28) 
HRECALLHRECARecalls 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  
HRECOVERHRECOVRecovers 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.

Be the first to comment

Leave a Reply

Your email address will not be published.


*


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