MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Find out last referenced date for datasets

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
bauer
Intermediate


Joined: 10 Oct 2003
Posts: 315
Topics: 49
Location: Germany

PostPosted: Mon Feb 06, 2017 12:01 pm    Post subject: Find out last referenced date for datasets Reply with quote

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.

Any helpful hints welcome,
thank you.
Bauer
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Mon Feb 06, 2017 1:11 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message Send e-mail Visit poster's website
bauer
Intermediate


Joined: 10 Oct 2003
Posts: 315
Topics: 49
Location: Germany

PostPosted: Mon Feb 06, 2017 2:47 pm    Post subject: Reply with quote

kolusu,

I have a pl/1 coding which calls IGGCSI00 to find out dataset namens which match a given wildcard. This works, no problem.

For each dataset, returned by IGGCSI00, I like now to find out the last referred date (and some other fields from IGGCSI00).

Thank you for the hint with IDCAMS, LISTVTOC. Let me read the documentation if the required field is returned and available from PL/1.

The interesting thing is: This third party product https://dovetail.com/docs/coz/dsp-ref_catsearch.html returns the required field and seems to use IGCSI00 too (and any other component ....)?!

Bauer
Back to top
View user's profile Send private message
bauer
Intermediate


Joined: 10 Oct 2003
Posts: 315
Topics: 49
Location: Germany

PostPosted: Mon Feb 06, 2017 2:53 pm    Post subject: Reply with quote

This is helpful:

http://www.ibm.com/support/knowledgecenter/en/SSLTBW_2.1.0/com.ibm.zos.v2r1.ikja300/ldsi.htm

But it's REXX, not PL/1 and / or COBOL.
Back to top
View user's profile Send private message
bauer
Intermediate


Joined: 10 Oct 2003
Posts: 315
Topics: 49
Location: Germany

PostPosted: Mon Feb 13, 2017 4:35 am    Post subject: Reply with quote

Update:

- The catalog search interface IGGCSI00 doesn't provide the required field
- The required field is provided by REXX procedure LISTDSI, datafield SYSREFDATE
- REXX can be called by PL/1 and/or COBOL, see here https://www.ibm.com/support/knowledgecenter/en/SSLTBW_2.1.0/com.ibm.zos.v2r1.rexa100/h1981605305.htm
- BUT: LISTDSI is not supported in NON TSO address spaces, see here https://www.ibm.com/support/knowledgecenter/SSLTBW_2.2.0/com.ibm.zos.v2r2.ikja300/overfff.htm
- So no way, to call direct from PL/1 using IRXJCL or IRXEXEC any REXX which uses LISTDSI, no way to get access to the information "last referenced date" only using PL/1


To handle the desired field in PL/1 seems only be possible, if

- Step1: REXX, LISTDSI, write Information to file
- Step2: Read this file using PL/1

Sad Sad Sad
Back to top
View user's profile Send private message
misi01
Advanced


Joined: 02 Dec 2002
Posts: 629
Topics: 176
Location: Stockholm, Sweden

PostPosted: Mon Feb 13, 2017 5:43 am    Post subject: Last referral date Reply with quote

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
Code:

       linkage section.                                         
      *                                                         
           copy iggcsirc.                                       
      *                                                         
       01  csi-returned-fields.                                 
           02  csi-all-returned-lengths.                         
               03  csi-ret-DSCRDT2-length pic s9(4) comp-5.     
               03  csi-ret-gdgaltdt-length pic s9(4) comp-5.     
               03  csi-ret-entname-length  pic s9(4) comp-5.     
               03  csi-ret-volser-length   pic s9(4) comp-5.     
      *                                                         
           02  csi-ret-DSCRDT2         pic x(4).                 
           02  csi-ret-gdgaltdt        pic x(4).                 
           02  csi-ret-entname         pic x(44).               
           02  csi-ret-volser-list.                             
             03  csi-ret-volser        pic x(6) occurs 99 times.

as well as
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.

This leads me to be wonder what is meant by "Last alteration date" as shown here https://www.ibm.com/support/knowledgecenter/SSLTBW_2.2.0/com.ibm.zos.v2r2.idac100/c1060.htm (I couldn't find any reference to REFERENCE date on that page)

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.

_________________
Michael
Back to top
View user's profile Send private message Send e-mail
bauer
Intermediate


Joined: 10 Oct 2003
Posts: 315
Topics: 49
Location: Germany

PostPosted: Wed Feb 15, 2017 4:06 am    Post subject: Reply with quote

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.

Do you have helpful hints?

Bauer

Code:


,                            ,Data Set Information,                           
,Command ===>                                                                 
                                                                           
,Data Set Name . . . . :,    XYZ   
,, ,
,General Data,                        ,,Current Allocation,                 
,,Management class . . :,       ,     ,,Allocated tracks  . :,992         
,,Storage class  . . . :,       ,     ,,Allocated extents . :,1           
,,,Volume serial . . . :,       , ,     ,,, ,                               
,,,Device type . . . . :,       ,     ,, ,                               
,,Data class . . . . . :,   ,     ,, ,                                 
,,,Organization  . . . :,PS      ,     ,Current Utilization,               
,,,Record format . . . :,FB    ,       ,,Used tracks . . . . :,992         
,,,Record length . . . :,223    ,      ,,Used extents  . . . :,1           
,,,Block size  . . . . :,32558   ,     ,,, ,
,,,1st extent tracks . :,992          ,,, ,
,,,Secondary tracks  . :,150          ,,Dates,                             
,,,Data set name type  :,          ,   ,,Creation date . . . :,2012/08/03        (1)
,,,                     , ,            ,,Referenced date . . :,2017/02/15        (3)
,,,                     ,        ,     ,,Expiration date . . :,***None***        (2)
,,,SMS Compressible  . :,NO  ,


Back to top
View user's profile Send private message
misi01
Advanced


Joined: 02 Dec 2002
Posts: 629
Topics: 176
Location: Stockholm, Sweden

PostPosted: Wed Feb 15, 2017 5:33 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message Send e-mail
bauer
Intermediate


Joined: 10 Oct 2003
Posts: 315
Topics: 49
Location: Germany

PostPosted: Wed Feb 15, 2017 1:43 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Wed Feb 15, 2017 2:51 pm    Post subject: Reply with quote

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

http://www.mvsforums.com/helpboards/viewtopic.php?t=2758&highlight=refdt

Chapter 1.3 discusses in detail about filtering

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/DGT2U2B1/CCONTENTS
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
misi01
Advanced


Joined: 02 Dec 2002
Posts: 629
Topics: 176
Location: Stockholm, Sweden

PostPosted: Sun Feb 19, 2017 4:48 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message Send e-mail
bauer
Intermediate


Joined: 10 Oct 2003
Posts: 315
Topics: 49
Location: Germany

PostPosted: Tue Feb 21, 2017 2:53 am    Post subject: Reply with quote

misi01,

yes, you are right Very Happy

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"

But ok, not possible in one step.

Have a nice day.

bauer
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
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


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group