Re: How to determine Alternate ID

2007-02-01 Thread Ronald van der Laan

I wanted to replace my LCLQRY package on the VM download page, but forgot
one step in the submission process, and was wondering why the updated code
didn't showup.  After rereading the instructions, I noticed my failure and
resubmitted, but this time using the correct format.
The LCLQRY code (z/VM 5.2 ready) is now available on the download page.

My apologies for the delay...

Ronald van der Laan


Re: How to determine Alternate ID

2006-12-29 Thread Don Russell

Don Russell wrote:

[snip]

That is, how can I determine what my ORIGINID would be if I sent a 
spool file to another ID?


The LCLQRY package seems like the best solution however, even that 
level of modification is a little sticky. As a compromise, I wrote the 
following little EXEC (QALTID EXEC) I thought I'd share in case anybody 
is looking for the same information.


/**/
/* Provide a REXX function to obtain the ALTID in effect for the  */
/* calling userid. If no ALTID is in effect, it returns the ID it is  */
/* running on.*/
/**/
/* altid = 'QALTID'() */
/**/
/* Don Russell - 29 December 2006 */
/**/
/**/
trace Off
address command

'PIPE',
  'CP QUERY ALTID|',
  'SPECS W-1|',
  'VAR ALTID'

if (rc = 0) then return altid

/**/
/* CP QUERY ALTID is not available on this system ... ho hum  */
/* Roll up our sleeves and do it the hard way.*/
/**/
'GETFMADR'
if (rc = 0) then parse pull . . vprt .

'PIPE',
  'STRLITERAL /SPOOL' vprt 'TO' userid()'/|',
  'STRLITERAL /DEFINE PRINTER' vprt'/|',
  'CP'

'PIPE',
  'STRLITERAL X0140|',
  'URO' vprt'|',
  'TAKE LAST 1|',
  'SPECS /QUERY VIRTUAL' vprt'/|',
  'CP|',
  'DROP FIRST 3|',
  'TAKE FIRST 1|',
  'SPECS W5|',
  'VAR SPID|',
  'SPECS /CLOSE 'vprt'/ 1 WRITE /DETACH 'vprt'/ 1|',
  'CP'

parse value diag('F8',spid) with 13 origin +8 .
origin = strip(origin)

parse value diag('08','PURGE * RDR' spid) with .

return origin

--- end of exec ---

I thought I could do it all with a single pipe line, but when I do that the URO 
fails saying the specified device doesn't exist. Splitting it in two was 
simpler than figuring it out further.

Of course comments, improvements are welcome.

Don Russell


Re: How to determine Alternate ID

2006-12-26 Thread Don Russell

Dennis Schaffer wrote:

If you're talking about CA's VM:Batch, code executing on a worker machine
(i.e. the customer application) can issue the "VMBATCH SERVICE STACK $USER"
to place on the program stack the userid of the submitting job.
  
In my case it is IBM VM Batch, not the CA product. Regardless, it's not 
the userid of the submitting job I need. That is already available as 
the "jobowner" parm passed to DGROOLY EXEC.


What I need is the ALTID value used by the submitter.

When the ALTID is specified on a BATCH SUBMIT  command, the jobowner (as 
far as VM Batch is concerned) is still the ID submitting the job. That 
ALTID value is not passed to DGROOLY, so DGROOLY has to resort to other 
means of obtaining it:




A more generic solution is the following rexx code which will obtain the
same information by perusing z/VM's VMDBK control block:

if substr(userid,1,6) = 'VMBAT0' then do
   numeric digits 12
   parse value diag(8,'CP LOCATE VMDBK ' userid) ,
 with . '15'x . $vmdbk .
   $addr = x2d($vmdbk) + x2d('5F0')
   $addr = insert('.8',d2x($addr,8),8)
   parse value diag(8,'CP D HT'$ADDR) with ,
 . . . . . . $userids .
   userid=strip(substr($userids,2,8))
end


The problem I see with this is the use of a privileged command. CP 
LOCATE is not generally available for all users. Of course a mod could 
make it available, but that sort of breaks the "no mods" philosophy.


I like the LCLQRY approach... even my 'brute force' approach is growing 
on me :-)


Don


Re: How to determine Alternate ID

2006-12-26 Thread Dennis Schaffer
I apologize for stepping into this conversation late and if someone has
already covered this ...

If you're talking about CA's VM:Batch, code executing on a worker machine
(i.e. the customer application) can issue the "VMBATCH SERVICE STACK $USER"
to place on the program stack the userid of the submitting job.

A more generic solution is the following rexx code which will obtain the
same information by perusing z/VM's VMDBK control block:

if substr(userid,1,6) = 'VMBAT0' then do
   numeric digits 12
   parse value diag(8,'CP LOCATE VMDBK ' userid) ,
 with . '15'x . $vmdbk .
   $addr = x2d($vmdbk) + x2d('5F0')
   $addr = insert('.8',d2x($addr,8),8)
   parse value diag(8,'CP D HT'$ADDR) with ,
 . . . . . . $userids .
   userid=strip(substr($userids,2,8))
end

Dennis
Mutual of Omaha


This e-mail and any files transmitted with it are confidential and are solely 
for the use of the addressee.  It may contain material that is legally 
privileged, proprietary or subject to copyright belonging to Mutual of Omaha 
Insurance Company and its affiliates, and it may be subject to protection under 
federal or state law.  If you are not the intended recipient, you are notified 
that any use of this material is strictly prohibited.  If you received this 
transmission in error, please contact the sender immediately by replying to 
this e-mail and delete the material from your system.  Mutual of Omaha 
Insurance Company may archive e-mails, which may be accessed by authorized 
persons and may be produced to other parties, including public authorities, in 
compliance with applicable laws.


Re: How to determine Alternate ID

2006-12-24 Thread Ronald van der Laan

Don,

Thanks for helping me out with my spelling ;-)
I'll fix that typo and will replace the package with the latest 5.2 code
next week.

Ronald van der Laan


Re: How to determine Alternate ID

2006-12-23 Thread Don Russell

Ronald van der Laan wrote:

Don,

My LCLQRY code is a loadable CP command that does not requires a local 
mod to CP, just do a CPXLOAD and define the two provided QUERY 
commands (done in the exit code).


Ronald, thank you for clarifying that... I (incorrectly) assumed it was 
a CP Mod, which I wanted to avoid.


Well, it was fun writing the pipe, but I look forward to replacing it 
all with a single line of QUERY ALTID. :-)

Thank for writing this and making it available.

When I went to the package download website I noticed a typo in the 
package description...
Currently reads as: This package lets you extent CP with two additional 
query commands:
Should be: This package lets you **extend* *CP with two additional query 
commands:


Ref: http://www.vm.ibm.com/download/packages/descript.cgi?LCLQRY

Don


Re: How to determine Alternate ID

2006-12-23 Thread Ronald van der Laan

Don,

My LCLQRY code is a loadable CP command that does not requires a local mod
to CP, just do a CPXLOAD and define the two provided QUERY commands (done in
the exit code).

Ronald van der Laan


Re: How to determine Alternate ID

2006-12-22 Thread Don Russell

Kris Buelens wrote:


This will satifiy your needs
  http://www.vm.ibm.com/download/packages/descript.cgi?LCLQRY
much easier than opening an APPC connection (as Alan says), or 
punching a file to yourself and check the sender (as I did before LCLQRY)
LCLQRY can also tell who XAUTOLOGed a user.  LCLQRY provides a class G 
solution to query your own, and a priviledged one to query the info 
for other users.




Thanks Kris and Alan...

I ended up using a pipe command to create a small spool file, extracting 
the spool id from a QUERY V  command and then using Diag F8 to 
get the originid of the spool file, and finally purging the now useless 
file. :-)


Works like a champ I imagine it's "expensive", but compared to the 
rest of the job running it's negligible.


It's too bad VM Batch doesn't pass the ALTID info to DGROOLY in the 
first place


The LCLQRY would be nice... but we have a tendency to stay as "vanilla" 
as possible... only making such mods if there is no other way


Don


Re: How to determine Alternate ID

2006-12-22 Thread Kris Buelens
This will satifiy your needs
  http://www.vm.ibm.com/download/packages/descript.cgi?LCLQRY
much easier than opening an APPC connection (as Alan says), or punching a 
file to yourself and check the sender (as I did before LCLQRY)
LCLQRY can also tell who XAUTOLOGed a user.  LCLQRY provides a class G 
solution to query your own, and a priviledged one to query the info for 
other users.

Kris,
IBM Belgium, VM customer support


The IBM z/VM Operating System  wrote on 
2006-12-22 01:34:58:

> IBM VM BATCH uses Diag D4 to set an Alternate ID for task IDs, so in
> some ways the task machine is "masquerading" as a different userid.

> The BATCH SUBMIT command accepts an ALTID option which is used by that
> Diag D4, but the job owner is still the actual job submitter.

> The DGROOLY EXEC runs on the task ID, and one of the parameters passed
> is the job owner. But I want to determine if there is an ALTID in 
effect.

> Short of doing something gross like sending myself a spool file and
> checking the origin id, either of the spool file or looking at the IMSG,
> how can I determine the Alternate User ID of the ID I'm actually running 
on?

> That is, how can I determine what my ORIGINID would be if I sent a spool
> file to another ID?

> This is on z/VM 4.4

> Thanks,
> Don Russell

Re: How to determine Alternate ID

2006-12-21 Thread Alan Altmark
On Thursday, 12/21/2006 at 04:34 PST, Don Russell 
<[EMAIL PROTECTED]> wrote:
> IBM VM BATCH uses Diag D4 to set an Alternate ID for task IDs, so in
> some ways the task machine is "masquerading" as a different userid.

> That is, how can I determine what my ORIGINID would be if I sent a spool
> file to another ID?
> 
> This is on z/VM 4.4

Issue an APPCVM CONNECT (CMALLC) to a private resource of your own 
creation.  The alternate ID is used as the source id in the connection. Of 
course, it's way easier to send a spool file to yourself and use diag 0xBC 
to look at the originid, and then discard it.

Your ESM may have a privileged query.  CP doesn't.

Alan Altmark
z/VM Development
IBM Endicott


How to determine Alternate ID

2006-12-21 Thread Don Russell
IBM VM BATCH uses Diag D4 to set an Alternate ID for task IDs, so in 
some ways the task machine is "masquerading" as a different userid.


The BATCH SUBMIT command accepts an ALTID option which is used by that 
Diag D4, but the job owner is still the actual job submitter.


The DGROOLY EXEC runs on the task ID, and one of the parameters passed 
is the job owner. But I want to determine if there is an ALTID in effect.


Short of doing something gross like sending myself a spool file and 
checking the origin id, either of the spool file or looking at the IMSG, 
how can I determine the Alternate User ID of the ID I'm actually running on?


That is, how can I determine what my ORIGINID would be if I sent a spool 
file to another ID?


This is on z/VM 4.4

Thanks,
Don Russell