View previous topic :: View next topic
|
Author |
Message |
feellikeneo
New User
Joined: 19 Mar 2007 Posts: 73 Location: Chennai
|
|
|
|
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 |
|
Back to top |
|
|
Pandora-Box
Global Moderator
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
|
|
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 |
|
|
feellikeneo
New User
Joined: 19 Mar 2007 Posts: 73 Location: Chennai
|
|
|
|
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 |
|
Back to top |
|
|
feellikeneo
New User
Joined: 19 Mar 2007 Posts: 73 Location: Chennai
|
|
|
|
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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
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 |
|
|
feellikeneo
New User
Joined: 19 Mar 2007 Posts: 73 Location: Chennai
|
|
|
|
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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
Back to top |
|
|
feellikeneo
New User
Joined: 19 Mar 2007 Posts: 73 Location: Chennai
|
|
|
|
Thanks Expat,
Let me go through that link and see if it solves my problem
Thanks again
Cheers,
Neo |
|
Back to top |
|
|
feellikeneo
New User
Joined: 19 Mar 2007 Posts: 73 Location: Chennai
|
|
|
|
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 |
|
Back to top |
|
|
Douglas Wilder
Active User
Joined: 28 Nov 2006 Posts: 305 Location: Deerfield IL
|
|
|
|
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 |
|
|
feellikeneo
New User
Joined: 19 Mar 2007 Posts: 73 Location: Chennai
|
|
|
|
Hi Douglas,
Your piece of code looks great.. Thanks for your help.. I hope this will satisfy my requirement.
Thanks a lot,
Cheers,
Neo |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
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 |
|
|
sannddyy
New User
Joined: 19 Feb 2008 Posts: 4 Location: chennai
|
|
|
|
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 |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Quote: |
I have a flat file with PDSs as its members |
Are you sure? |
|
Back to top |
|
|
sannddyy
New User
Joined: 19 Feb 2008 Posts: 4 Location: chennai
|
|
|
|
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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
Yes, you can |
|
Back to top |
|
|
sannddyy
New User
Joined: 19 Feb 2008 Posts: 4 Location: chennai
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
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 |
|
|
sannddyy
New User
Joined: 19 Feb 2008 Posts: 4 Location: chennai
|
|
|
|
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 |
|
|
|