View previous topic :: View next topic
|
Author |
Message |
pravin1234jd
New User
Joined: 31 May 2010 Posts: 11 Location: India
|
|
|
|
Dear All,
I need to write a REXX to get the last userid of any member,
For example, Below are the members...
PRAVIN.PROD.COBOL(TESTPGM1)
PRAVIN.PROD.COBOL(TESTPGM2)
PRAVIN.PROD.COBOL(TESTPGM3)
PRAVIN.PROD.COBOL(TESTPGM4)
I need to get the LAST USERID of these members, which is displayed in ISPF menu as below
Name Prompt Size Created Changed ID
TESTPGM1 6158 2006/07/27 2011/05/30 03:54:00 PRAVIN
I tried to use USERID() function to get it but this fucntion was returning my userid only and not that of last user id the member....
Kindly provide the directions...
regards
Pravin |
|
Back to top |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
Do you mean user who has last modified the member? |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
ISPF Statistics are a function of ISPF, not a development language. Try making a call to the LMMLIST ISPF Service. |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
Back to top |
|
|
pravin1234jd
New User
Joined: 31 May 2010 Posts: 11 Location: India
|
|
|
|
@sambhaji,
Yes, i mean user who has last modified the member...
Thanks |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10886 Location: italy
|
|
|
|
the ISPF statistics are a bit weak as auditing support...
ispf option 3.5 ( reset ISPF statistics ) will set the ISPF statistics almost to everything
so you might just be wasting time |
|
Back to top |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
pravin1234jd wrote: |
@sambhaji,
Yes, i mean user who has last modified the member...
Thanks |
Well.. then there were better ways to ask this question ... what you explained at start was very confusing... |
|
Back to top |
|
|
pravin1234jd
New User
Joined: 31 May 2010 Posts: 11 Location: India
|
|
|
|
@enrico-sorichetti
I know userid can be changed manual so thats a loophole but still is there is any way I can get it by REXX.
@sambhaji,
As teh question is clear , any idea about how we could do it... |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2454 Location: Hampshire, UK
|
|
|
|
Someone has already pointed to a working example and someone has pointed you to to the LM functions. Use the Rexx manual and ISPF services manual (I think for LM services) to do what you want. You could check it against sillysot. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10886 Location: italy
|
|
|
|
Yes. if You have the skill to write the REXX script
You were already given two options...
the LMMLIST
and the syllysot link
show what You have written and somebody will be happy to help |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
pravin1234jd, superk provided you a clear indication of what you need to do, and then even provided a link to a REXX program that provides the data you asked for.
So, why are you STILL asking how to do it when you've been told (at least twice) how to do it? |
|
Back to top |
|
|
pravin1234jd
New User
Joined: 31 May 2010 Posts: 11 Location: India
|
|
|
|
thx superk,enrico-sorichetti,Nic Clouston,Robert Sample for you directions
I have got it done by using LMMLIST but I am facing another problem....
If my pds name is MYUSREID.DEV.JCLLIB I have to use it as "DEV.JCLLIB"
if I use it as "MYUSREID.DEV.JCLLIB" LMINIT give RC=8
because of this I can not use this rexx to get last userid of production or any other userid member.
How can I make it use dsn name as i give in input ?
Please provide me directions, I will get my way thru if .... |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
When you are specifying MYUSREID.DEV.JCLLIB, your useid is getting automatically pre-pended, to give MYUSREID.MYUSREID.DEV.JCLLIB. When you use DEV.JCLLIB then you get what you want, MYUSREID.DEV.JCLLIB.
So, you have to find out how to stop the system automatically preprending your user-id to a dataset for your execution of your rexx. |
|
Back to top |
|
|
vasanthz
Global Moderator
Joined: 28 Aug 2007 Posts: 1744 Location: Tirupur, India
|
|
|
|
Hello,
I assume that there is a problem with ' or " on the PDS name..So the command takes your userID as the first qualifier of the dataset by default.
But we could help you only if you provide the code that you have tried and also run it with trace.
Edited: Bill beat me to the reply |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
There is also the good old PROFILE NOPREFIX |
|
Back to top |
|
|
pravin1234jd
New User
Joined: 31 May 2010 Posts: 11 Location: India
|
|
|
|
thanks Bill Woodger & vasanthz for quick reply
Below is the REXX code which I used
Code: |
DSNAME = 'DEV.JCLLIB'
ISPEXEC "LMINIT DATAID(LMID) DATASET(" DSNAME ")"
SAY RC
SAY DSNAME
ISPEXEC "LMOPEN DATAID(" LMID ")"
SAY RC
MEMBER = 'BINDJCL'
ISPEXEC "LMMLIST DATAID("LMID") MEMBER(MEMBER) STATS(YES)"
SAY RC
SAY ZLMDATE ZLMTIME ZLUSER MEMBER |
[/code] |
|
Back to top |
|
|
vasanthz
Global Moderator
Joined: 28 Aug 2007 Posts: 1744 Location: Tirupur, India
|
|
|
|
try this,
Code: |
DSNAME = 'FULL.PDS.NAME'
ISPEXEC "LMINIT DATAID(LMID) DATASET('"DSNAME"')" |
|
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
When running rexx and there is a problem, I first look at the code for the "obvious" and then run it with a trace (I like "trace i").
If you had done this, you'd have seen what was happening.
You have all the SAYs, once you have it "working" are you going to replace them with proper error-checking or just let is roll? You'll save yourself (or others) time if you do the error-checking code. To me, there is not much point in ever leaving it out (to make a new program, copy some working code that has tricky bits close to what you want, use the editor (initially, DD-DD, D, that sort of stuff) but leave the error-checking).
At this point we are assuming you read Vasanthz's post and Peter's post and have a solution or two.
Edit: or even the explicit one from Mojo-Jojo. |
|
Back to top |
|
|
pravin1234jd
New User
Joined: 31 May 2010 Posts: 11 Location: India
|
|
|
|
Thanks vasanthz, Its working....
Thank you guys.... I have got what I was looking for. This forum was very much helpful...
You guys Rock |
|
Back to top |
|
|
vasanthz
Global Moderator
Joined: 28 Aug 2007 Posts: 1744 Location: Tirupur, India
|
|
|
|
They don't have mojo-jojo, hooded claw, past master, metallakats... etc.. these days..
gone-forever |
|
Back to top |
|
|
pravin1234jd
New User
Joined: 31 May 2010 Posts: 11 Location: India
|
|
|
|
As a part of this forums rules I need to post which solution worked for me....
I am copying here the code which solved my requirement...
PS. This code is without any error handling as of now
Code: |
DSNAME = 'MYUSERID.DEV.JCLLIB'
ISPEXEC "LMINIT DATAID(LMID) DATASET('" DSNAME "')"
SAY RC
SAY DSNAME
ISPEXEC "LMOPEN DATAID(" LMID ")"
SAY RC
MEMBER = 'BINDJCL'
ISPEXEC "LMMLIST DATAID("LMID") MEMBER(MEMBER) STATS(YES)"
SAY RC
SAY ZLMDATE ZLMTIME ZLUSER MEMBER |
|
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Thank you for posting your soluton - it will probably help someone else one day
d |
|
Back to top |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
PeterHolland wrote: |
There is also the good old PROFILE NOPREFIX |
The quote solution has my preference, so there is no need to change the profile of whoever is running the program.
(I've never been able to understand if the change is for the session only or permanent.)
Name within quotes = no userid prefixed |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
Marso wrote: |
PeterHolland wrote: |
There is also the good old PROFILE NOPREFIX |
The quote solution has my preference, so there is no need to change the profile of whoever is running the program.
(I've never been able to understand if the change is for the session only or permanent.)
Name within quotes = no userid prefixed |
Its for the whole on line session, in batch its just for the job.
I like it very much to use, cause i dont have to think to much about
all kinds of quotes. But then im a lazy person. |
|
Back to top |
|
|
|