MainframeSupports
tip week 40/2008:

Did you know that it is quite easy to retrieve information about migrated datasets without using the HLIST command. The fact is that the HLIST command only retrives a tiny part of all the information HSM stores about migrated datasets. The information is stored by HSM in a dataset called the MCDS. It is possible to read the MCDS using SORT which gives you a lot of opportunities.

The first obstacle is to find out what the name of the MCDS is at your installation. When I arrive at a new installation I use the following approach: I start by issuing a TSO ISRDDN and then I use command ENQ. In the ENQ display I fill out Major name with SYSZARC, blanks out the other fields and press Enter. The column Job name contains the name of the HSM task. Now there is two ways of determining the MCDS dataset name. You can use the ENQ command again and use SYSDSN as Major name and fill in field Jobname with the name of the HSM task and press Enter. If one of the displayed datasets has a suffix of MCDS then this is very likely to be the MCDS dataset name. The other method is to access SDSF or SYSVIEW and find out which dataset name is allocated to DD-name MIGCAT in the HSM task.

The next obstacle is of course RACF. If you do not have READ access to the MCDS dataset then you have to convince the security guys that you desperately need to have access to the MCDS without using HSM.

The last obstacle before actually retrieving data is of course to be able to interpret the data in the MCDS. This requires access to the manual called DFSMShsm Diagnosis. This link is directly to the paragraph describing the layout of the different records contained in a MCDS. The manual used to be inaccessible on the internet, but I found it on the z/OS V1R9.0 DFSMS Bookshelf.

Now you can start retrieving information with this piece of JCL:

//HSMHLIST EXEC PGM=SORT
//SORTIN   DD DISP=SHR,DSN=MY.MCDS
//SORTOUT  DD SYSOUT=*
//SYSIN    DD *
 OPTION ZDPRINT
 SORT FIELDS=COPY
 INCLUDE COND=(1,7,CH,EQ,'MYUSER.')
 OUTREC FIELDS=(1,44,X,65,6,X,117,4,BI,ZD,X,273,4,BI,ZD)
/*

In this example the MCDS is called MY.MCDS. The step scans all of the MCDS and writes to SYSOUT only the records containing MYUSER. in the first seven positions. This is the same as issuing a HLIST LEVEL(MYUSER.), but the step takes a lot more time to execute than the HLIST command as the HLIST command does a direct access to the dataset. On the other hand using SORT it is possible to retrieve all kinds of records on all kinds of criterias.

In the example I have chosen to retreive a few but interesting pieces of information. Of course column 1-44 contains the name of a migrated dataset. Column 65-70 contains VOLSER for the disk or tape where the dataset is migrated to. Column 117-120 contains the number of bytes occupied by the dataset in HSM which is absolutely not the same number as HLIST outputs. Column 117-120 is "The real thing". Empty datasets may occupy more than 0 bytes. I have made some research and discovered that datasets occupying less than 691 bytes may be regarded as empty if DFDSS is used as "data mover" which most installations do.

The four bytes in column 273-276 contains a relative position on the tape to which the dataset is migrated (only relevant for datasets migrated to tape). I used this field in combination with VOLSER for a task where I had to recall thousands of datasets. I discovered that if I recalled the datasets in the order of first VOLSER and next relative position then a recall on average took two seconds. This is a vast improvement compared to a normal recall from tape which on average takes between 30 seconds and one minute.

Previous tip in english        Sidste danske tip        Tip list