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 

PDS members - creation dates ?

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


Joined: 10 Feb 2006
Posts: 188
Topics: 68

PostPosted: Wed Apr 29, 2009 9:14 am    Post subject: PDS members - creation dates ? Reply with quote

Is there a utility that will tell me the creation date of all members of a PDS ?

Thanks for any help ...
Back to top
View user's profile Send private message
dbzTHEdinosauer
Supermod


Joined: 20 Oct 2006
Posts: 1411
Topics: 26
Location: germany

PostPosted: Wed Apr 29, 2009 9:57 am    Post subject: Reply with quote

Print Directory of a Partitioned Data Set

myself, I would use the index option of 3.4, and then capture the printout from my ISPF List dataset (after exiting ispf and then reentering.

unfortunately, ISPF PDS statistics are only available if the PDS, during allocation/definition, statistics are on.
_________________
Dick Brenholtz
American living in Varel, Germany
Back to top
View user's profile Send private message
Bill Dennis
Advanced


Joined: 03 Dec 2002
Posts: 579
Topics: 1
Location: Iowa, USA

PostPosted: Wed Apr 29, 2009 12:14 pm    Post subject: Reply with quote

Just to clarify, statistics are not set during PDS allocation/definition but rather are dependent on STATS ON setting of the ISPF EDIT profile used during edit. Profile used is generally based on the dataset name LLQ.
_________________
Regards,
Bill Dennis

Disclaimer: My comments on this foorum are my own and do not represent the opinions or suggestions of any other person or business entity.
Back to top
View user's profile Send private message
dbzTHEdinosauer
Supermod


Joined: 20 Oct 2006
Posts: 1411
Topics: 26
Location: germany

PostPosted: Wed Apr 29, 2009 12:33 pm    Post subject: Reply with quote

good point and thx for the clarification, Bill
_________________
Dick Brenholtz
American living in Varel, Germany
Back to top
View user's profile Send private message
taltyman
JCL Forum Moderator
JCL Forum Moderator


Joined: 02 Dec 2002
Posts: 310
Topics: 8
Location: Texas

PostPosted: Wed Apr 29, 2009 9:08 pm    Post subject: Reply with quote

Bill Dennis wrote:
Just to clarify, statistics are not set during PDS allocation/definition but rather are dependent on STATS ON setting of the ISPF EDIT profile used during edit. Profile used is generally based on the dataset name LLQ.
and can be altered and as such cannot be trusted.
Back to top
View user's profile Send private message
tcurrier
Intermediate


Joined: 10 Feb 2006
Posts: 188
Topics: 68

PostPosted: Thu Apr 30, 2009 7:32 am    Post subject: Reply with quote

A coworker was able to find some REXX code that he wrote a while ago to read a PDS directory, rather than the PDS listing itself.

This code will extract the PDS member creation date (with some manipulation of the input data). It can also be modified to extract the member modification date and the modification time.

Code:
/* REXX */
Trace O
/*  For batch, use the following JCL:

    //REXX     EXEC PGM=IRXJCL,PARM='name.of.rexx.exec'
    //SYSEXEC  DD DSN=your.rexx.library,DISP=SHR
    //SYSTSPRT DD SYSOUT=*
    //SYSTSIN  DD DUMMY
    //PDS      DD DSN=your.pds.name,DISP=SHR,
    //         DCB=(RECFM=F,DSORG=PS,LRECL=256,BLKSIZE=256)

*/

/*  For TSO, use the following ALLOCATE sequence:   */
 ARG dsn
   dsnx = "'"||dsn||"'"
   ADDRESS TSO
   "ALLOC F(PDS) DA("dsnx") SHR REUSE",
   "  RECFM(F) DSORG(PS) LRECL(256) BLKSIZE(256)"

ADDRESS TSO "ALLOC FILE(XXRPT)",
            "DSNAME('H2501T4.PDSOUT.DIRECT')",
            "MOD REUSE"
/*-------------------------------------------------------------------*/
call 2000_cal
/*-------------------------------------------------------------------*/
"EXECIO * DISKR PDS (STEM DIR. FINIS"  /* read pds directory         */
DO blk = 1 to dir.0
  usedbytes = C2D(SUBSTR(dir.blk,1,2))
  index = 3                            /* skip past used bytes       */
  DO WHILE index < usedbytes
    IF SUBSTR(dir.blk,index,8) = 'FFFFFFFFFFFFFFFF'x THEN
        SIGNAL direof
    pds2name = SUBSTR(dir.blk,index,8) /* member name                */
    SAY pds2name                       /* do-wah-diddy, we're here   */
    index = index + 11                 /* skip past name and ttr     */
    pds2indc = SUBSTR(dir.blk,index,1)
    len = BITAND(pds2indc,'1F'x)       /* isolate user data length   */
    userdata = C2D(len) * 2            /* halfwords to bytes         */
    if userdata = 30 then
        CALL 1000_get_date
    index = index + userdata + 1       /* skip past user data        */

    queue pds2name xdate
    ADDRESS TSO "EXECIO 1 DISKW XXRPT"

  END

END
direof:
PUSH ''
ADDRESS TSO "EXECIO * DISKW XXRPT (finis"
EXIT
/* ========================================== */
1000_get_date:
  cdi = index + 5
  cr_date = c2x(substr(dir.blk,cdi,4))
  y1 = substr(cr_date,1,2)
  y2 = substr(cr_date,3,2)
  if y1 = '01' then
     yy = 20||y2
  else
     yy = 19||y2

  jdays = substr(cr_date,5,3)

  r1 = y2//4
  if r1 = 0 then
    cal.2 = 29
  else
    cal.2 = 28

  do i = 1 to 12
     if jdays > cal.i then
        jdays = jdays - cal.i
     else
        do
          dd = jdays
          mm = i
          i = 12
        end
  end
  xdate =  mm||'/'||dd||'/'||yy
RETURN
/* ------------------------ */
2000_cal:
   cal.1  = 31
   cal.2  = 28
   cal.3  = 31
   cal.4  = 30
   cal.5  = 31
   cal.6  = 30
   cal.7  = 31
   cal.8  = 31
   cal.9  = 30
   cal.10 = 31
   cal.11 = 30
   cal.12 = 31
RETURN
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Thu Apr 30, 2009 5:10 pm    Post subject: Reply with quote

tcurrier,

Hmm isn't it simple using LMMFIND with stats on option? zlc4date and zlm4date have the create date and last modified date

Here is a rexx code from archives


Code:

/* REXX   LIST THE STATISTICS OF GIVEN PDS                          */
PDSNAME='your pds name' /* GIVE YOUR PDS NAME                       */
ADDRESS TSO "ALLOC F(MYPDS) DA('"PDSNAME"') SHR REU"                   
ADDRESS ISPEXEC "LMINIT DATAID(DID) DDNAME(MYPDS) ENQ(SHWR)"           
ADDRESS ISPEXEC "LMOPEN DATAID("DID") OPTION(INPUT)"                   
/* RETREIVE MEMBER LIST WITH  LISTDS COMMAND                        */
X = OUTTRAP('VAR.')                                                   
"LISTDS '"PDSNAME"' MEMBERS"                                           
X = OUTTRAP('OFF')                                                     
DO I = 7 TO VAR.0         /*  PROCESS ALL MEMBERS OF SOURCE PDS     */
   MEM = LEFT(STRIP(SUBSTR(VAR.I,3,8)),8,' ')                         
   ADDRESS ISPEXEC "LMMFIND DATAID("DID") MEMBER("MEM") STATS(YES)" 
   SAY 'MEMBER ' MEM 'WAS CREATED ON : ' ZLC4DATE,   
       ' AND IS LAST MODIFIED ON : ' ZLM4DATE         
END                                                                   
ADDRESS ISPEXEC "LMCLOSE DATAID("DID")"                               
ADDRESS ISPEXEC "LMFREE DATAID("DID")"                                 
ADDRESS TSO "FREE F(MYPDS)"                                           
Back to top
View user's profile Send private message Send e-mail Visit poster's website
tcurrier
Intermediate


Joined: 10 Feb 2006
Posts: 188
Topics: 68

PostPosted: Thu Apr 30, 2009 6:45 pm    Post subject: Reply with quote

Kolusu,

Yes, it does appear to be simple using your example. Wink

Thank you.
Back to top
View user's profile Send private message
somuk
Beginner


Joined: 04 Feb 2003
Posts: 113
Topics: 37

PostPosted: Thu Sep 24, 2009 5:00 am    Post subject: Reply with quote

Hi,
I would like to modify the above rexx (tcurrier's solution) to find out the last modified date of each member in the PDS. Can some one please help me.. I'm not able to use Kolusu's solution since this batch job is going to run in zeke and I'm not able to allocate the ISPF profile libraries..
_________________
Regds,
Somu
Back to top
View user's profile Send private message Yahoo Messenger
expat
Intermediate


Joined: 01 Mar 2007
Posts: 475
Topics: 9
Location: Welsh Wales

PostPosted: Thu Sep 24, 2009 5:55 am    Post subject: Reply with quote

Just as well that the job does not use any ISPF libraries, so zeke away Mr. Green
_________________
If it's true that we are here to help others,
then what exactly are the others here for ?
Back to top
View user's profile Send private message
superk
Advanced


Joined: 19 Dec 2002
Posts: 684
Topics: 5

PostPosted: Thu Sep 24, 2009 8:23 am    Post subject: Reply with quote

I've used this code from the IBM website with success:

List a PDS directory from the z/OS UNIX tools page.
Back to top
View user's profile Send private message
semigeezer
Supermod


Joined: 03 Jan 2003
Posts: 1014
Topics: 13
Location: Atlantis

PostPosted: Thu Sep 24, 2009 10:26 am    Post subject: Reply with quote

or another : http://sillysot.com/ftp/mlrexx.txt
_________________
New members are encouraged to read the How To Ask Questions The Smart Way FAQ at http://www.catb.org/~esr/faqs/smart-questions.html.
Back to top
View user's profile Send private message Visit poster's website
somuk
Beginner


Joined: 04 Feb 2003
Posts: 113
Topics: 37

PostPosted: Fri Sep 25, 2009 1:29 am    Post subject: Reply with quote

Thank you very much superk and semigeezer
Those links are really helpful..!!!
_________________
Regds,
Somu
Back to top
View user's profile Send private message Yahoo Messenger
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities 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