DFHSM dataset level commands
HSM Dataset Level Commands
These commands can be used by non-authorised users (users who are not DFHSM administrators) when prefixed with an 'H'. Authorised users can also use them without the 'H' if they are preceded by HSEND. For example
HSEND LIST DSNAME(my.file) BOTH will give the same result as HLIST DSNAME(my.file) BOTH
I find the 'H' commands very useful as line commands from TSO option 3.4. You enter the command on the left hand side of the dataset you want to action, and just use a '/' where you would normally have to type in the dataset. TSO will substitute the dataset name for the / in the commands.
The Dataset Tips section contains a number of examples of these commands in action.
When you look at a list of datasets under TSO 3.4, migrated volumes are shown with a disk entry of MIGRAT1 if they are on ML1, or MIGRAT2 if they are on ML2.
When you issue the command 'SORT VOLUME' on the command line this only sorts on the first 6 characters of the VOLUME, so if you want to sort migrated datasets you can get MIGRAT1 and MIGRAT2 datasets mixed together.
To get round this problem you have to enter the command 'SORT VOLUME MVOL' on the command line. This will cause a sort of the volume and also the 'Multivolume or Migration Level indicator'.
Many DFHSM commands echo the results to your terminal by default. If you enter a command and see no result, then DFHSM probably wrote the result to the DFHSM log file. If you add the parameter 'TERM' to your command, it will echo the result to your console.
If you want to save the command output, you can add the parameter ODS(file.name) to redirect the output to a file. The file must not exist, as DFHSM will allocate it. You can also send the results to the spool with SYSOUT(class)
The LIST command has a lot of parameters that make it useful for finding out information about backups or migrated files. It is easiest to use as a line command on ISPF option 3.4 as shown below.
HLIST DSNAME(/) BOTH HLIST DSNAME(/) MCDS HLIST DSNAME(/) BCDS
Typical results of these commands are
DSN=dataset.name MIGVOL=AQ3940 DSO=PS SDSP=NO LAST REF=08/02/11 MIG=04/02/19 TRKS=0010425 2K BLKS= ******* TIMES MIG= 001 16K BLKS=031332 LAST MIGVOL=*NONE* DSN= dataset.name BACK FREQ = *** MAX VERS=*** BDSN=HSM.BACK.T581109.dataset.name.J4058 BACKVOL=AQ3829 FRVOL=DS003E BACKDATE=08/02/27 BACKTIME=09:11:57 CAT=YES GEN=000 VER=001 UNS/RET= NO RACF IND=NO BACK PROF=NO
If you also wanted information about datasets that have not been migrated, then add the INCLUDE PRIMARY parameter. This will then give you details about files that have been migrated and recalled.
The list command will also give you lots of information about DFHSM objects. Here are a few examples
LIST BACKUPVOLUME LIST BACKUPVOLUME(volser) LIST BACKUPVOLUME SELECT(EMPTY)
The first command will list out all backup volumes, the second one will list out data for a selected backup volume, while the third command will list out all empty backup volumes.
To list out all the migrated files held on a tape. Its best to direct the output of this command into a file, as there will be lots of it. You may need to do this if the tape is broken, to see what you have lost. The information is held in the OCDS, so you do not need to mount the tape. If you want to list out one volume, but do not want the migrated files list, use the parameter NODATASETINFORMATION to suppress the list.
HSEND LIST TTOC(AQ1086) ODS(list.output.filename)
If you specify TTOC without a VOLSER, then HSM will list out a summary of all of its tapes, but it will not list out all the individual files on the tapes.
If you want to list out all your disaster recovery migration tapes, maybe for a Dr test, then use the command
HSEND LIST TTOC SELECT(DISASTERALTERNATEVOLUMES)
To list out the contents of a small dataset packing dataset on an ML1 volume use the command below. You can also see all the files on an ML1 volume with SELECT(VOLUME(volser) ML1)
HSEND LIST DATASETNAME MIGRATIONCONTROLDATASET - SELECT(VOLUME(ML1028) SDSP) ODS(list.output.filename)
You can also filter out a set of migrated datasets with the level parameter. The command below will lost all migrated datasets with high level qualifier of CQPY
HSEND LIST LEVEL(CQPY) MIGRATIONCONTROLDATASET ODS(list.output.filename)
List the DFHSM characteristics of a primary volume. Note the TERM parameter. The LIST command sends it's output to the HSM log by default.
TSO HSEND LIST PVOL(D30038) TERM
VOL=D30038 DEVTYP=3390 VOLTYPE=P SMS MIGDS=00000 MIGTRKS=****** MIGDATE-TIME=04/03/01 13:12 FRAG=.687 HI-THRESH=085 LO-THRESH=060 MIN-AGE=*** BACKUP-DEVICE-CATEGORY=**** AUTO-RECALL=* SDSP=*** SPACE-MGMT=MIG AGE=*** AUTO-HOST MIG=** BACK=** DUMP=** DUMPCLASS = ******** ARC0140I LIST COMPLETED, 5 LINE(S) OF DATA OUTPUT ***
To list out all the backups for files that match a partial dataset name use
HSEND LIST LEVEL(partial.dsname) BCDS ODS(file.name)
You can also filter down a large HSM list using the SELECT parameter. As an example
HLIST LEVEL(RSJPROD) SELECT(AGE(10 50)) MCDS TERM
will list out all migrated datasets starting with RSJPROD that have not been referenced for less than 10 days, or more than 50 days. Note that the LEVEL statement does not have to be a complete qualifier. This command will find RSJPRODP.* files for example. There is quite a few SELECT parameters that you can use, including VOLUME(volser), ML1, ML2, SDSP, NOSDSP and VSAM.
To list out all the files that were on a primary volume last time it was backed up use
HSEND LIST PVOL(volser) BCDS BACKUPCONTENTS ODS(file.name)
The LIST TTOC command can take some special SELECT filters, including SELECT(BACKUP NOTFULL), which will show all backup tapes that are not full, and SELECT(NOTASSOCIATED) which will list all tapes that are not associated with an HSM function.
You can list out DUMP objects as shown below. If you do not specify a particular class or volume, then all classes or volumes will be listed out.
LIST DUMPCLASS(class) LIST DUMPVOLUME(volser)
You use this command to manually backup a dataset. You may want to do this before you make changes. The 3.4 line command can simply be
You will have a default backup destination; use the QUERY SETSYS command to find out what it is. You can override this as in the following example. This example will also use concurrent copy for the backup 'CC' means Concurrent Copy, 'REQUIRED' means the backup will fail if it cannot use concurrent copy, and 'LE' means the backup will be considered complete once the concurrent copy is established, rather than when all the data is copied off to tape.
BACKDS file.name TARGET(DISK) CC(REQUIRED LE)
You use this command to restore a data set from the backup. From ISPF option 3.4, this can simply be
HRECOVER / REPLACE
And hopefully you will see
ARC0778I DATA SET recovered.filename WAS RECOVERED FROM A BACKUP MADE AT ARC0778I (CONT.) 09:11:57 ON 2004/02/27 ARC1000I recovered.filename RECOVER PROCESSING ENDED
You can recover a file to a different name, and select a backup taken on a specific date with the following TSO command
HSEND RECOVER recovered.filename NEWNAME(recovered.filename.newname) - DATE(99/11/04)
This command will recover a file to a new name, and force it onto a non-SMS volume
HSEND RECOVER recovered.filename NEWNAME(recovered.filename.newname) - TOVOLUME(V00101) UNIT(3390) FORCENONSMS
If you want to delete a lot of backups, you will want to batch them up and run them as a job. When you do this, DFHSM will issue all the commands at once and queue them up. If the queue is too large, DFHSM will abend! You can avoid this by using the WAIT parameter as shown below. HSM will then process each delete one at a time.
HSEND WAIT BDELETE (filename1) HSEND WAIT BDELETE (filename2) HSEND WAIT BDELETE (filename3) HSEND WAIT BDELETE (filename4)
N.B. The commands as shown above will delete ALL backups for the file. If you just want to delete specific backups, you need to add a VERSIONS parameter.
You use this command to manually migrate a data set. You may want to do this a 'quick fix' to resolve space problems. At its simplest, the 3.4 line command is
HMIG DSNAME(/) or HMIG DSNAME(/) ML2
Another option is to use the command below, which means migrate all files off volume PRIM01 that have not been accessed for 5 days.
MIGRATE VOLUME(PRIM01 MIGRATE(5))
If you have a problem with ML1 filling up, you may need the following command, which migrates all datasets that have been on ML1 for 2 days or more to ML2
MIGRATE MIGRATIONLEVEL1 DAYS(2)
You can also empty out a primary volume with DFHSM by using the CONVERT parameter. This means that the datasets are migrated then immediately recalled again. To clear out a volume called PRIM01, set it to DISNEW in DFSMS, then issue the following command, which will move any files that are not in use elsewhere in the SMS pool. There are much easier ways to move data off a volume of course.
MIGRATE VOLUME(PRIM01 MIGRATE(0) CONVERT)
This command will bring a data set back to primary disk. You do not need to recall a file manually; DFHSM will recall it automatically if you try to use it. However, it can be a pain waiting for a lot of files that are archived to tape, you may want to recall them by command. You will also need t use the command if autorecall is having problems. DFHSM recall is a file by file operation, you cannot batch up requests and recall a lot of files at the same time like FDRABR.
The ISPF 3.4 line command is simply
If DFHSM is struggling to find space to recall a large file, you can use either of these two options
HRECALL / DFDSSOPTION VOLCOUNT(ANY) HRECALL / FORCENONSMS UNIT(unittype) VOLUME(volser)
VOLCOUNT(ANY) will make the file go multi-volume, and will use up to 59 volumes.
You can use the FORCENONSMS option to make the recall go to an empty spare volume, but then you have to relocate the file later.
You can use the HLIST command to find out how much space the recall needs.
If you use the ISPF line command 'D' or 'DEL' to delete migrated files, DFHSM will recall the file first, which is a waste of time and resource. If you use HDELETE, then DFHSM deletes a migrated data set without recalling the data
The ISPF 3.4 line command is simply
Use the PURGE parameter for datasets which have an expiry date set. Incidentally, if you are deleting files in batch, then it is best to use IDCAMS rather than IEFBR14, as then DFHSM will delete the file without having to RECALL that dataset back to disk first. For example
//STEP01 EXEC PGM=IDCAMS //SYSPRINT DD SYSOUT=J //SYSIN DD * DELETE datasetname1 DELETE datasetname2