| View previous topic :: View next topic |
| Author |
Message |
Chumma Beginner
Joined: 10 Jan 2007 Posts: 12 Topics: 5 Location: India
|
Posted: Fri Feb 16, 2007 1:18 am Post subject: How shall I get the UserID who edits the Dataset? |
|
|
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 |
|
 |
warp5 Intermediate

Joined: 02 Dec 2002 Posts: 429 Topics: 18 Location: Germany
|
Posted: Fri Feb 16, 2007 2:31 am Post subject: |
|
|
| user = userid() |
|
| Back to top |
|
 |
Chumma Beginner
Joined: 10 Jan 2007 Posts: 12 Topics: 5 Location: India
|
Posted: Fri Feb 16, 2007 4:25 am Post subject: |
|
|
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 |
|
 |
acevedo Beginner

Joined: 03 Dec 2002 Posts: 127 Topics: 0 Location: Europe
|
Posted: Fri Feb 16, 2007 4:35 am Post subject: |
|
|
search for GRS...
something like
| Code: |
address tso "console syscmd(d grs,res=(*,"yourdsnhere"))"
|
|
|
| Back to top |
|
 |
Nic Clouston Advanced
Joined: 01 Feb 2007 Posts: 1075 Topics: 7 Location: At Home
|
Posted: Fri Feb 16, 2007 5:19 am Post subject: |
|
|
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 |
|
 |
dbzTHEdinosauer Supermod
Joined: 20 Oct 2006 Posts: 1411 Topics: 26 Location: germany
|
Posted: Fri Feb 16, 2007 5:57 am Post subject: |
|
|
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 |
|
 |
Chumma Beginner
Joined: 10 Jan 2007 Posts: 12 Topics: 5 Location: India
|
Posted: Fri Feb 16, 2007 6:01 am Post subject: |
|
|
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 |
|
 |
semigeezer Supermod
Joined: 03 Jan 2003 Posts: 1014 Topics: 13 Location: Atlantis
|
Posted: Fri Feb 16, 2007 8:54 am Post subject: |
|
|
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 |
|
 |
|
|
|