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.
LIST command
Use this command to find 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=A03940 DSO=PS SDSP=NO
LAST REF=04/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=A03829 FRVOL=D3003E
BACKDATE=04/02/27 BACKTIME=09:11:57 CAT=YES GEN=000 VER=001 UNS/RET= NO
RACF IND=NO BACK PROF=NO
The list command will also give you lots of information about DFHSM objects. Here are a few examples
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.
HSEND LIST TTOC (A01086) ODS(list.output.filename)
List out the contents of an ML1 volume
HSEND LIST DATASETNAME MIGRATIONCONTROLDATASET -
SELECT(VOLUME(ML1028) SDSP) ODS(list.output.filename)
List the DFHSM characteristics of a primary volume. Note the TERM parameter.
This command sends it's output to the HSM log by default.
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
HBACK /
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)
HRECOVER Command
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
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.
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.
MIGRATION commands
HMIGRATE Command
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)
HRECALL Command
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
HRECALL /
If DFHSM is struggling to find space to recall a large file, you can use either of these two options
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.
HDELETE Command
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
HDEL /
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