Yes. You are correct that this information, just like the information obtained from a LISTCAT or FileAid, may not be exact especially if the dataset is open or if it was not closed properly. However, for my purpose, which is to simply get an overall view of DASD Utilization, this method will suffice. In my environment, all of the pertinent VSAM files are closed and De-Allocated at least once, if not more, per day. Also note that I'm talking about a development environment, not Production.
My interest in this issue is part of a larger project. I'm developing a REXX tool that generates a DASD Utilization report of all files in the environment. As an application developer, I do not have access to SMF or DCOLLECT info, so I am using the tools available to me (i.e. IDCAMS, LISTDSI, MVS utilities).
My REXX gathers dataset attributes and DASD usage from various sources and generates a consolidated report showing the current utilization (which may not be accurate for some files, but is close enough to provide a general representation).
In addition to simple reporting, my REXX provides features such as issuing HSM Migrate commands for files that have not been accessed in a specific period of time (hence why I need the Last Ref Date). This utility also Recalls specified files that are Migrated to ensure that these files are on DASD so that jobs using them will not be hung up with HSM during execution. There are also several other features that I provide in this REXX that are designed to increase productivity. However, a goal of our management is to be more efficient with the use of DASD. So I set out to develop this REXX to assist us. And indeed using this REXX has resulted in the freeing up of a tremendous amount of DASD (tens of thousands of Cylinders so far). Being able to obtain the Last Ref Date for VSAM files will enable my REXX to apply the same ability to Migrate these files as with NONVSAM files, and will surely result in even more efficiency. Obviously a test environment has many files on DASD that may not serve a current purpose.
Unfortunately, to obtain all the information required for my process, the REXX needs to pull information from many sources. Currently I'm using LISTDSI for NONVSAM files and LISTCAT for VSAM files. However, now I'm adding IEHLIST to the mix also. But getting the Lst Ref date is critical to the features of my process, so the extra processing required is worth the result. There were really only two remaining issues: obtaining the Last Ref Date for VSAM and to accurately calculate the DASD Usage of PDSE files (I have a post on this board also, but I guess nobody has an answer). So with IEHLIST, I've narrowed the outstanding issues to only one.
Even with all the work that the Rexx performs, it is still a very efficient process considering the data sources it has to work with. Also, by limiting these sources to common utilities allows this REXX process to be portable from site to site considering that most application developers will not have access to goodies like SMF, DCOLLECT, etc. Although it would be nice to get all the data from one source, it is what it is. Too bad LISTCAT doesn't show Last Ref Date.
Thanks for your help.