Vignesh:

What Binyamin was telling you is that in the PSA (Prefixed Storage Area), there is a pointer to the current ASCB (Address Space Control Block). In that control block at the field named ASCBASID, you will find the ASID value you want. In either fashion, JOB or TSO/ISPF, this is the value you are after. In REXX, it's pretty simple and I could give you the two lines you want, but this is an opportunity to learn something.

First, you ought to go to Mark Zelden's webpage (mzeldon.com/mvsutil.html) and download his iplinfo rexx procedure, which is a wonderful example of using REXX to search data in storage. Once you have it, browse or edit it and search for the first occurence of ASCB. You'll see a line that sets the variable ASCB from data located at location 224 in fixed storage, which is the storage address of the PSAAOLD field. Now you have the address of the ASCB.

Next, you need to find where in the ASCB the ASID value is located. If you are goinf to want to play around with control blocks, you need to learn to interpret them and should be looking at the MVS Control Blocks manual that contains the ASCB layout. The manual is online, so layout you can look at it. When you do, find the ASCB and look for the ASCBASID field. get it's offset and add it to the value you got for ASCB. Using a similar REXX line as you see that gets the ASCB value, get your ASID.

If you get this far and are still stuck, email me and I'll help you get further.

Mike Myers
Senior z/OS systems programmer and consultant
Mentor Services Corporation

02/04/2016 07:54 AM, Elardus Engelbrecht wrote:
Binyamin Dissen wrote:

PSAAOLD->ASCB (ASCBASID)
That chasing of the pointers should work.

Vignesh wrote:

:>If I'm running a REXX via a job, the output should be the ASID of the job.
:>If I'm running a REXX via a ISPF, the output should be the ASID of my logon 
procedure.
What do you want to do with that ASID? Perhaps there is a better solution or 
way to get this info.

Groete / Greetings
Elardus Engelbrecht

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN


----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to