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 

How shall I get the UserID who edits the Dataset?

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF
View previous topic :: View next topic  
Author Message
Chumma
Beginner


Joined: 10 Jan 2007
Posts: 12
Topics: 5
Location: India

PostPosted: Fri Feb 16, 2007 1:18 am    Post subject: How shall I get the UserID who edits the Dataset? Reply with quote

I am coding an Edit macro in rexx for editing a dataset at cursor position.

I would like to get the userid of the user who currently edits the particular dataset.

How shall I trace out the USERID?
Back to top
View user's profile Send private message
warp5
Intermediate


Joined: 02 Dec 2002
Posts: 429
Topics: 18
Location: Germany

PostPosted: Fri Feb 16, 2007 2:31 am    Post subject: Reply with quote

user = userid()
Back to top
View user's profile Send private message Visit poster's website
Chumma
Beginner


Joined: 10 Jan 2007
Posts: 12
Topics: 5
Location: India

PostPosted: Fri Feb 16, 2007 4:25 am    Post subject: Reply with quote

Plz correct me if am wrong.

USERID() traces the logon ID,in this case who execute my macro.

But how shall i get to know the user who currently edits a particular dataset xyz?

Thanks for your time!
Back to top
View user's profile Send private message
acevedo
Beginner


Joined: 03 Dec 2002
Posts: 127
Topics: 0
Location: Europe

PostPosted: Fri Feb 16, 2007 4:35 am    Post subject: Reply with quote

search for GRS...
something like
Code:

address tso "console syscmd(d grs,res=(*,"yourdsnhere"))"     
Back to top
View user's profile Send private message
Nic Clouston
Advanced


Joined: 01 Feb 2007
Posts: 1075
Topics: 7
Location: At Home

PostPosted: Fri Feb 16, 2007 5:19 am    Post subject: Reply with quote

To execute the edit macro you must be editing the file so it is YOU who is editing it. If the file is being edited by someone else then you cannot edit it and the macro cannot run. If you now want to find out who is editing the file someplaces has a 'whohas' type of command '===> whohas my.file'. However, it may not be available in your shop and I do not know about GRS as specced above by acevedo.
_________________
Utility and Program control cards are NOT, repeat NOT, JCL.
Back to top
View user's profile Send private message
dbzTHEdinosauer
Supermod


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

PostPosted: Fri Feb 16, 2007 5:57 am    Post subject: Reply with quote

Chumma,

are you having contention issues? here is something that Doug Nadel wrote:

Quote:
In z/OS 1.2, the ISRDDN command can be called from within ISPF with a parameter of a command and the ENQ command was enhanced to take a data set name (tso conventions) that way, so... You can type, for example:

DDLIST ENQ CLIST
and see the enqs for 'userid.CLIST'

or
DDLIST ENQ 'ABC.CNTL'
etc. That should also work as a command from a rexx exec as long as you are in ISPF.

There is also an ISPF service called QUERYENQ in z/OS 1.2 which returns a table of ENQ holders and requestors.

Pre-ISPF 5.2, you probably need an assembler interface. ..

_________________
Dick Brenholtz
American living in Varel, Germany
Back to top
View user's profile Send private message
Chumma
Beginner


Joined: 10 Jan 2007
Posts: 12
Topics: 5
Location: India

PostPosted: Fri Feb 16, 2007 6:01 am    Post subject: Reply with quote

You are right, this works in ISPF command line.

Shall we able to replicate this command in a macro?

My macro pseudocode is
Edit the dataset > Check the return code for dataset in use > If so,display the UserID
Back to top
View user's profile Send private message
semigeezer
Supermod


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

PostPosted: Fri Feb 16, 2007 8:54 am    Post subject: Reply with quote

A couple of things to clear up:
  • You can run an edit macro when someone else is editing the data set because you can be running in View mode which does not ENQ the data set.
  • You can call the QUERYENQ service to get the id of other user who is editing the data set (if any). To find the editor, be sure to use an RNAME of SPFEDIT and the correct format of the QNAME. For PDS members, 44 byte padded dsname+8 byte member name. For sequential files, check the doc, 'cause I forget the format or if there even is an SPFEDIT ENQ for sequentials.
    ISPF Table ENQs also use the SPFEDIT ENQ. Try it in ISRDDN to see how this works.
  • Use QUERYENQ to find out who has the data set allocated, even if they are not in the editor. Use the standard RNAME for data set ENQs (SYSDSN, if I remember right)
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF 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