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

How to get last user id of member


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

New User


Joined: 31 May 2010
Posts: 11
Location: India

PostPosted: Fri Aug 05, 2011 7:13 pm
Reply with quote

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
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Fri Aug 05, 2011 7:15 pm
Reply with quote

Do you mean user who has last modified the member?
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Fri Aug 05, 2011 7:29 pm
Reply with quote

ISPF Statistics are a function of ISPF, not a development language. Try making a call to the LMMLIST ISPF Service.
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Fri Aug 05, 2011 7:37 pm
Reply with quote

This is a link to a website that has a REXX program to read a PDS directory and show the ISPF stats:

www.sillysot.com/ftp/mlrexx.txt
Back to top
View user's profile Send private message
pravin1234jd

New User


Joined: 31 May 2010
Posts: 11
Location: India

PostPosted: Fri Aug 05, 2011 7:49 pm
Reply with quote

@sambhaji,
Yes, i mean user who has last modified the member...

Thanks
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10886
Location: italy

PostPosted: Fri Aug 05, 2011 7:55 pm
Reply with quote

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 icon_biggrin.gif
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Fri Aug 05, 2011 8:27 pm
Reply with quote

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... icon_rolleyes.gif
Back to top
View user's profile Send private message
pravin1234jd

New User


Joined: 31 May 2010
Posts: 11
Location: India

PostPosted: Fri Aug 05, 2011 8:57 pm
Reply with quote

@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 icon_biggrin.gif , any idea about how we could do it...
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2454
Location: Hampshire, UK

PostPosted: Fri Aug 05, 2011 9:09 pm
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10886
Location: italy

PostPosted: Fri Aug 05, 2011 9:09 pm
Reply with quote

Yes. if You have the skill to write the REXX script icon_cool.gif

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
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8700
Location: Dubuque, Iowa, USA

PostPosted: Fri Aug 05, 2011 9:11 pm
Reply with quote

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
View user's profile Send private message
pravin1234jd

New User


Joined: 31 May 2010
Posts: 11
Location: India

PostPosted: Mon Aug 08, 2011 12:23 pm
Reply with quote

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 icon_cool.gif ....
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Mon Aug 08, 2011 12:33 pm
Reply with quote

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
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1744
Location: Tirupur, India

PostPosted: Mon Aug 08, 2011 12:35 pm
Reply with quote

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
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Mon Aug 08, 2011 12:39 pm
Reply with quote

There is also the good old PROFILE NOPREFIX
Back to top
View user's profile Send private message
pravin1234jd

New User


Joined: 31 May 2010
Posts: 11
Location: India

PostPosted: Mon Aug 08, 2011 12:42 pm
Reply with quote

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
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1744
Location: Tirupur, India

PostPosted: Mon Aug 08, 2011 12:55 pm
Reply with quote

try this,
Code:
DSNAME = 'FULL.PDS.NAME'
ISPEXEC "LMINIT DATAID(LMID) DATASET('"DSNAME"')"
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Mon Aug 08, 2011 12:59 pm
Reply with quote

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
View user's profile Send private message
pravin1234jd

New User


Joined: 31 May 2010
Posts: 11
Location: India

PostPosted: Mon Aug 08, 2011 1:09 pm
Reply with quote

Thanks vasanthz, Its working....

Thank you guys.... I have got what I was looking for. This forum was very much helpful...

You guys Rock icon_kidra.gif
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1744
Location: Tirupur, India

PostPosted: Mon Aug 08, 2011 1:10 pm
Reply with quote

They don't have mojo-jojo, hooded claw, past master, metallakats... etc.. these days..
gone-forever icon_cry.gif
Back to top
View user's profile Send private message
pravin1234jd

New User


Joined: 31 May 2010
Posts: 11
Location: India

PostPosted: Mon Aug 08, 2011 1:16 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Mon Aug 08, 2011 3:31 pm
Reply with quote

Thank you for posting your soluton - it will probably help someone else one day icon_smile.gif

d
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Mon Aug 08, 2011 8:49 pm
Reply with quote

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
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Mon Aug 08, 2011 9:32 pm
Reply with quote

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
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 System add a USER parm when job submi... TSO/ISPF 4
No new posts can an ISPF appl save user changes in... TSO/ISPF 14
No new posts COBOL 6.4 - User Defined Function nee... COBOL Programming 6
No new posts PuTTY - "User is not a surrogate... IBM Tools 5
No new posts How to delete a user's alias from the... JCL & VSAM 11
Search our Forums:

Back to Top