IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Access the "LAST CHANGED TIME" of a member in PDS


IBM Mainframe Forums -> TSO/ISPF
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
feellikeneo

New User


Joined: 19 Mar 2007
Posts: 73
Location: Chennai

PostPosted: Fri Jul 27, 2007 10:29 am
Reply with quote

Hi Friends,

I have some unique requirement. Hope somebody can help me out.
I need to find the "LAST CHANGED TIME" of each member in a given PDS.

----------------------------------------------------------------------------
NAME SIZE CREATED CHANGED ID

FILE1 312 2007/04/27 2007/07/26 10:19:00 TSORVAR
FILE2 318 2007/07/23 2007/07/26 09:55:53 TSORVAR
----------------------------------------------------------------------------

I need to get the last changed time, of FILE1(2007/07/26 10:19:00) and FILE2(2007/07/26 09:55:53).

When I used "LISTDS <DSN name> MEMBERS", I get only the name of the members and the LRECL, BLKSIZE of the PDS.

Hope I am clear. Please help me to come over this.

Thanks in advance,

Cheers,
Neo icon_smile.gif
Back to top
View user's profile Send private message
Pandora-Box

Global Moderator


Joined: 07 Sep 2006
Posts: 1592
Location: Andromeda Galaxy

PostPosted: Fri Jul 27, 2007 11:47 am
Reply with quote

Hi feellikeneo,

Go to the DSLIST and give i to the left of the dataset.It will give you the last reference date.If you had done some modifications to the dataset.It will show the reference date as the date when you have done your modifications
Back to top
View user's profile Send private message
feellikeneo

New User


Joined: 19 Mar 2007
Posts: 73
Location: Chennai

PostPosted: Fri Jul 27, 2007 2:18 pm
Reply with quote

Hi Prem

The "LAST REFERENCED DATE" will be the last refrenced date of the PDS and not its members.

And also, the last refrenced date will change even if I just open that PDS and close it without changing anything.

So we have to look at some other way..


Cheers,
Neo icon_smile.gif
Back to top
View user's profile Send private message
feellikeneo

New User


Joined: 19 Mar 2007
Posts: 73
Location: Chennai

PostPosted: Fri Jul 27, 2007 4:28 pm
Reply with quote

Hi Moderators,

Sorry that I missed a main note...

I need to do the above task "ACCESSING THE LAST CHANGED TIME OF A MEMEBER IN A PDS" using REXX macro.

Please consider this as a question in REXX and not in TSO/ISPF
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8796
Location: Welsh Wales

PostPosted: Fri Jul 27, 2007 4:44 pm
Reply with quote

Don't think you can find that out. If I recall correctly, not even SMF 15 records go down to member level for update.
Back to top
View user's profile Send private message
feellikeneo

New User


Joined: 19 Mar 2007
Posts: 73
Location: Chennai

PostPosted: Fri Jul 27, 2007 4:49 pm
Reply with quote

Hi Expat,

Could you pls explain what do you mean by this ", not even SMF 15 records go down to member level for update."

I could not get you....
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8796
Location: Welsh Wales

PostPosted: Fri Jul 27, 2007 6:15 pm
Reply with quote

Here's a link to help you find what you want

http://publib.boulder.ibm.com/cgi-bin/bookmgr/BOOKS/ISPZSG60/CCONTENTS?DT=20070722202444

You will need to use LMMLIST to get the information, but take a look at LMMDISP to get the list of variables that you can display.

The last update date and time are available from here.
Back to top
View user's profile Send private message
feellikeneo

New User


Joined: 19 Mar 2007
Posts: 73
Location: Chennai

PostPosted: Fri Jul 27, 2007 6:57 pm
Reply with quote

Thanks Expat,

Let me go through that link and see if it solves my problem

Thanks again

Cheers,
Neo icon_smile.gif
Back to top
View user's profile Send private message
feellikeneo

New User


Joined: 19 Mar 2007
Posts: 73
Location: Chennai

PostPosted: Fri Jul 27, 2007 7:55 pm
Reply with quote

Hi Expat,

I tried to use the below code,

/*REXX*/
"ISPEXEC LMINIT DATAID(MYID) DATASET 'TSORVAR.TEST3')"
"ISPEXEC LMOPEN DATAID(MYID) OPTION(OUTPUT)"
"ISPEXEC LMMDISP DATAID(MYID) OPTION(DISPLAY) MEMBER(DEMO) STATS(YES)"
SAY ZLMDATE
-----------------

The above code just gave output as "ZLMDATE". Can you please help me on this. May be I am not sure how to use LMMLIST or LMMDISP.

Can you please help me out...

Thanks in advance,

Cheers,
Neo icon_smile.gif
Back to top
View user's profile Send private message
Douglas Wilder

Active User


Joined: 28 Nov 2006
Posts: 305
Location: Deerfield IL

PostPosted: Fri Jul 27, 2007 10:34 pm
Reply with quote

I found this on this forum some time ago but I cannot find it now so I will repost it.

Code:

/*Rexx routine to read a pds directory and show the ispf stats     */ 
/*     non load module only.                                       */ 
/* Author: Doug Nadel - 3/31/2001 */                                   
Parse Upper Arg dsname .                                               
If 0<>listdsi(dsname) Then                                             
  Do                                                                   
    Say 'Data set 'dsname' not allocated'                             
    Exit                                                               
  End                                                                 
If 'PO'<>substr(sysdsorg,1,2) Then                                     
  Do                                                                   
    Say 'Data set 'dsname' is not a pds'                               
    Exit                                                               
  End                                                                 
Address tso                                                           
'ALLOC F(AREAD) DS('dsname') SHR REUSE DSORG(PS) LRECL(256) RECFM(F B)'
'EXECIO * DISKR AREAD ( FINIS STEM DIRS.'                             
'FREE F(AREAD)'                                                       
Do blocknum = 1 to dirs.0                                             
'FREE F(AREAD)'                                   
Do blocknum = 1 to dirs.0                         
  block=dirs.blocknum                             
  Parse Var dirs.blocknum bl 3 block               
  block=substr(block,1,c2d(bl)-2)                 
  Do While block<>''                               
    Parse Var block name 9 ttr 12 c 13 block       
    c=c2d(bitand(c,'1f'x))                         
    If name='FFFFFFFFFFFFFFFF'x Then               
      Leave blocknum                               
    stats=''                                       
    If c=15 & sysrecfm \= 'U' Then                 
      stats=decodestats(substr(block,1,30))       
    Say name stats                                 
    block=delstr(block,1,c*2)                     
  End                                             
End                                               
Exit                                               
decodestats:  Procedure  /* decode the directory */
direntry=Arg(1)                                   
  Parse Var direntry,                                               
    vv 2 mm 3 flags 4 ss 5 crecc 6 crdate 9 modcc 10 moddate 13 hh, 
    14 tm 15 lines 17 init 19 mod 21 userid 28 .                     
  Parse Value c2x(crdate)  with cyy 3 cjjj 6 .                       
  Parse Value c2x(moddate) with myy 3 mjjj 6 .                       
  out=leftd(vv)'.'leftd(mm)                       /* Vv.Mm         */
  out=out 19+c2x(crecc)cyy'.'cjjj                 /* Create date   */
  out=out 19+c2x(modcc)myy'.'mjjj                 /* Mod date      */
  out=out leftx(hh)':'leftx(tm)':'leftx(ss)       /* mod time      */
  out=out right(c2d(lines),5)                     /* Lines         */
  out=out right(c2d(init),5)                      /* Initial lines */
  out=out right(c2d(mod),5)                       /* Mod lines     */
  out=out userid                                  /* User id       */
  If bitand(flags,'80'x) = '80'x Then                               
    out=out '(SCLM)'                              /* Saved by SCLM */
  Return out                                                         
leftd: return right(c2d(arg(1)),2,'0')                               
leftx: return right(c2x(arg(1)),2,'0')                               

This will give you the last modified date and time along with other information. These fields are updated by ISFP edit, but these members may be modified by other programs without updating these statistics.
Back to top
View user's profile Send private message
feellikeneo

New User


Joined: 19 Mar 2007
Posts: 73
Location: Chennai

PostPosted: Sat Jul 28, 2007 12:12 pm
Reply with quote

Hi Douglas,

Your piece of code looks great.. Thanks for your help.. I hope this will satisfy my requirement.

Thanks a lot,


Cheers,
Neo icon_smile.gif
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8796
Location: Welsh Wales

PostPosted: Sat Jul 28, 2007 3:41 pm
Reply with quote

Try this
Code:

/*REXX*/                                                               
"ISPEXEC LMINIT DATAID(MYID) DATASET 'TSORVAR.TEST3')"                 
"ISPEXEC LMOPEN DATAID(MYID) OPTION(OUTPUT)"                           
DEMO = ' '
RCX  = 0
DO WHILE RCX = 0
  "ISPEXEC LMMLIST DATAID(MYID) OPTION(DISPLAY) MEMBER(DEMO) STATS(YES)"
  RCX = RC
  SAY ZLMDATE  ZLMTIME
END
Back to top
View user's profile Send private message
sannddyy

New User


Joined: 19 Feb 2008
Posts: 4
Location: chennai

PostPosted: Wed Dec 03, 2008 6:21 pm
Reply with quote

Can anybody tell me if this can be done for multiple PDSs. What I mean is instead of a single PDS, if I have a flat file with PDSs as its members then is it possible to have a similar code (REXX Macro) for having the consolidated list as output???
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Wed Dec 03, 2008 6:24 pm
Reply with quote

Quote:
I have a flat file with PDSs as its members
Are you sure? icon_eek.gif
Back to top
View user's profile Send private message
sannddyy

New User


Joined: 19 Feb 2008
Posts: 4
Location: chennai

PostPosted: Wed Dec 03, 2008 6:29 pm
Reply with quote

Of course arun, what I mean is, the file will look something like this

1. Name of PDS1
2. Name of PDS2
3. Name of PDS3
4. Name of PDS4

Can I run a loop in REXX so that in its first iteration the I/P is the first PDS
Second iteration second PDS is the I/P

and so on
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8796
Location: Welsh Wales

PostPosted: Wed Dec 03, 2008 8:19 pm
Reply with quote

Yes, you can
Back to top
View user's profile Send private message
sannddyy

New User


Joined: 19 Feb 2008
Posts: 4
Location: chennai

PostPosted: Thu Dec 04, 2008 10:08 am
Reply with quote

hi there expat, thanks for the ray of hope but I would appriciate it if u could tell me how. I tried running a loop(do until) to repeat the same code but its just not working.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19243
Location: Inside the Matrix

PostPosted: Thu Dec 04, 2008 10:20 am
Reply with quote

Hello,

If you post the code you have so far (please use the "Code" tag for readability and to preserve alignment), someone will be able to help get the code working.
Back to top
View user's profile Send private message
sannddyy

New User


Joined: 19 Feb 2008
Posts: 4
Location: chennai

PostPosted: Thu Dec 04, 2008 10:24 am
Reply with quote

Hi dick,

I am using the same code as posted in page 1 of this forum. I have included a file instead of the usual read from terminal. I havwe added a loop which unfortunatly is not looping(used do until,do while)

thanks a lot
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> TSO/ISPF

 


Similar Topics
Topic Forum Replies
No new posts Access to macro definitions PL/I & Assembler 4
No new posts Access to non cataloged VSAM file JCL & VSAM 18
No new posts How to access web services/website? Mainframe Interview Questions 4
No new posts To get the the current time DFSORT/ICETOOL 13
No new posts RC query -Time column CA Products 3
Search our Forums:

Back to Top