Joined: 10 Oct 2003 Posts: 315 Topics: 49 Location: Germany
Posted: Mon Feb 06, 2017 12:01 pm Post subject: Find out last referenced date for datasets
Hi *,
I like to find out the "last reffernced" date (last used ....) of datasets using PL/1 or Cobol coding. - Field is provided using ISPF 3.4 and than SORT REF.
The IBM modul IGGCSI00 is know to me, but I can not find any helpful field in the returned result.
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
Posted: Mon Feb 06, 2017 1:11 pm Post subject:
bauer,
Are you trying to find out based on the dataset name wild card filter?
Couple of options for you.
1. IDCAMS DCOLLECT (provided that you are authorized)
2. LISTVTOC if the VOLUME is known where the dataset resides. _________________ Kolusu
www.linkedin.com/in/kolusu
Joined: 02 Dec 2002 Posts: 629 Topics: 176 Location: Stockholm, Sweden
Posted: Mon Feb 13, 2017 5:43 am Post subject: Last referral date
It being quiet at the moment, I thought I'd look at this problem since it seemed interesting. I found the basis of code that can be used here http://mainframe.elevengestures.com/catalog-search-iggcsi00-from-cobol/. Basically, I changed it a bit and ended up with the following (small) changes to the code
* move 2 to csinumen
move 4 to csinumen
* Added by me
move 'DSCRDT2' to csifldnm(1)
move 'GDGALTDT' to csifldnm(2)
move 'ENTNAME' to csifldnm(3)
move 'VOLSER' to csifldnm(4)
The GDG I'm testing with contains 3 entries. The creation dates are 161124, 170111 and 170111. The referral dates (using S via 3.4) are 161124, 170213 and 170111 (the 170213 is simply because I deliberately edited the file and changed a record).
The trouble is, when I run the code variation above, I get (for DSCRDT2) the values 16329F01, 170111F01 and 170111F01 (as expected), but I get FFFF for all 3 entries for GDGALTDT.
As a simple test, I just changed the number of entries for the GDG from 3 to 5 thinking that MAYBE that would result in a change to GDGALTDT. No such luck.
After more searching, I found the following
Quote:
GDGALTDT - returns the last alteration date of the GDG base. This
represents the last date that a generation was added to, or deleted from
the base. This information is also displayed for a LISTCAT of a GDG
base. The GDG expiration date no longer exists, and if requested (via
the DSEXTDT2 field name) will always return 00.000.
Joined: 10 Oct 2003 Posts: 315 Topics: 49 Location: Germany
Posted: Wed Feb 15, 2017 4:06 am Post subject:
Hi misi01,
thank you for your interest in this topic.
My experience is:
Routine IGGCSI00 works for me in PL/1.
Datafield DSCRDT2 works. (see (1) in screenshot, this matches)
Datafield DSEXDT2 works. (see (2) in screenshot, this matches)
Datafield GDGALTDT doesn’t work. I never saw in my environment a correct content. So I agree with your doubts. – Is something like that anywhere available in any TSO panel?
What I’m looking for, is any option to get access to the “Referenced date”. See (3) in screenshot. This was my previous requirement.
This datafield is available using REXX procedure as discussed above. But not available using IGGCSI00.
Joined: 02 Dec 2002 Posts: 629 Topics: 176 Location: Stockholm, Sweden
Posted: Wed Feb 15, 2017 5:33 am Post subject:
Afraid not. Out of interest, WHY do you need the last referred date.
My experience has been that sometimes we think we HAVE to do something in a specific way. You then talk to a colleague and they come up with a work-around or (even better) a much more flexible way of solving the problem. _________________ Michael
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
Posted: Wed Feb 15, 2017 2:51 pm Post subject:
bauer wrote:
Well, this datafield is just someone kind of a indicator for me, to identify old, unused datasets.
In the next loop of course additional checks are done, before deleting the datasets.
Bauer,
I think ADRDSSU does a fantastic job of deleting the datasets based on the Last referenced date. Here is an example of deleting the datasets using ADRDSSU
Joined: 02 Dec 2002 Posts: 629 Topics: 176 Location: Stockholm, Sweden
Posted: Sun Feb 19, 2017 4:48 am Post subject:
Interesting how a discussion about one piece of software can turn into a suggestion to use a completely different one instead once the real original need is understood
I've never heard of ADRDSSU but will try and store it in my memory for another time. _________________ Michael
Joined: 10 Oct 2003 Posts: 315 Topics: 49 Location: Germany
Posted: Tue Feb 21, 2017 2:53 am Post subject:
misi01,
yes, you are right
My goal was:
a) Using PL/1 logic to read possible dataset names (IGGCSI00)
b) Using the field last ref date
c) Read part of the content
d) decision "delete" or "keep"
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum