1

I am using the IBM JZOS API to access PDS members and now I need some information about the members. There is the class PdsDirectory.MemberInfo.Statistics, so that I can create a PdsDirectory, iterate over it and get the Statistics of each member (e.g. modification date, last editing user,...) like so:

PdsDirectory dir = new PdsDirectory(args[0]);
for (Iterator iter = dir.iterator(); iter.hasNext(); ) {
   PdsDirectory.MemberInfo info = (PdsDirectory.MemberInfo)iter.next();
   System.out.println(info);
}

But I need those statistics only for one single file. Is there a way with

ZFile zFile = new ZFile("//DD:INPUT", "rb,type=record,noseek");

or creating a reader, to access those information? Or is the only way to create the directory and find the file I need?

Dora
  • 47
  • 1
  • 8

1 Answers1

2

The only information you can get for a data set is from the catalog. You can use the JZOS CatalogSearch class to do that from Java. There is a sample on github.

PDS member statistics are usually only present if you edit members using ISPF. ISPF stores statistics in the PDS directory user data field. Any application can use this field for whatever they like but it's usually only used by ISPF. There are no such statistics in the catalog. There is no last edited userid or record count etc. There is creation data, last referenced date and lots of other useful metadata. You may not find what you are looking for but most of the interesting stuff is in the Format 1 DSCB.

David Crayford
  • 571
  • 1
  • 3
  • 10
  • All members that I want to look at were edited with ISPF, so with the PdsDirectory code example I get all the Information I need. But in my case I have a list of member names and I want to check if they are present in the PDS Directory, and if so, I need the Information when and who changed them last. The only possible way I can see right now is to iterate over the whole Directory for each element of my to-check-list and compare the names. But that sounds very inefficient to me! But with the CatalogSearch I can't get those specific metainformation? – Dora Mar 23 '18 at 14:08
  • 1
    If you are looking for a reliable method to audit when a data set was opened then you should investigate [SMF 14/15](https://www.ibm.com/support/knowledgecenter/en/SSLTBW_2.1.0/com.ibm.zos.v2r1.ieag200/rec14.htm) records which give you everything you need. IMO, relying on ISPF statistics is not reliable. Any user with UPDATE authority can use ISPF 3.5 to reset ISPF member statistics. – David Crayford Mar 27 '18 at 03:49
  • There is also the [RACF Audit SMF 80](https://www.ibm.com/support/knowledgecenter/en/SSLTBW_2.1.0/com.ibm.zos.v2r1.icha300/toc.htm) records. – David Crayford Mar 27 '18 at 04:03