If the OP is willing to call an interface instead, the use ERBSMFI and get 
SMF79-1 records and look at the values in R791TAS.

CHKTRID is a good place to start if you are trying to work this out from 
control blocks yourself, but there are a few nuances to consider (assuming you 
have the ASCB address for the ASID) :

(o) If ASCBJBNI is non-zero, you need to get the CSCB from CHCSCBP (based 
CHNAME on ASCBJBNI)
(o) If ASCBJBNI is zero, use ASCBCSCB
(o) If CHJOBID, then you might have a JOB, but it will be STC if ASCBJBNI=0
(o) CHTSID = TSU
(o) Otherwise you have an STC, but then you need to identity ASCH, OMVS and 
INITs from jobnames

If you then want to accurately populate fields like “STEPNAME” and “PROCSTEP”  
you need to be careful as they can come from different places depending on the 
logic above.

It is a bit messy TBH.

Also bear in mind that ASID(0001) is called “SYSLOG” 😊

Rob Scott
Rocket Software



From: IBM Mainframe Discussion List <[email protected]> On Behalf Of 
Binyamin Dissen
Sent: Friday, December 8, 2023 11:57 AM
To: [email protected]
Subject: Re: Find the ASID type?

EXTERNAL EMAIL



CHTRKID ?

On Thu, 7 Dec 2023 21:32:27 -0600 Steve Horein 
<[email protected]<mailto:[email protected]>> wrote:

:>Hi!
:>Looking at messages CNZ4105I/CNZ4106I from an MVS DISPLAY ACTIVE command,
:>there is a tally of different address space types in the header:
:>
:>JOBS M/S TS USERS SYSAS INITS ACTIVE/MAX VTAM OAS
:>xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx/xxxxx xxxxx
:>
:>NetView has a RECEDATA function that "Provides information about the origin
:>of a command that was transferred to the NetView environment by using a
:>NETVONLY action in a Command Revision Table", that includes "ASTYPE", that
:>would return one of the following:
:>
:>Value Description
:>D USS persistent procedure. The address space has a name for initiated
:>programs, appropriate for a JOB. However, the existence of an OpenMVS
:>address space block indicates a special purpose USS persistent procedure.
:>J The address space is a JOB.
:>N The address space is a system address space started during operating
:>system initialization (NIP) processing.
:>S The address space is a Started Task (STC).
:>T The address space is a Time-Sharing User (TSO).
:>U The address space is a USS forked or spawned procedure.
:>* Error: the address space where the command originated has closed or else
:>the message is not from the local LPAR.
:>? Error: inconsistent data (might be a transient condition).
:>! Error: inconsistent data.
:>> Error: the supplied ASID is larger than the allowed ASID limit for the
:>system
:>
:>With the DISPLAY ACTIVE command knowing how many of each type there is, and
:>the RECEDATA function knowing the type of address space that just issued a
:>command, there seems to be an indicator to provide that kind of
:>information. What I am curious about, and would like to make use of, is
:>where the address space "type" can be found, given only a job name or ASID?
:>
:>For example, the ISG343I results of D GRS,RES=(SYSDSN,<some dataset>) can
:>identify the following:
:>SYSNAME JOBNAME ASID TCBADDR EXC/SHR OWN/WAIT
:>
:>If I wanted to know that the JOBNAME was a TSO user, a USS process, STC, or
:>a batch job, is it possible to definitively find out?
:>I was looking at ASCBJBNI and ASCBJBNS, but it seems there is still
:>ambiguity. I'm not sure if I could tell the difference between a TSO user
:>and a Started task just from ASCBJBNS.
:>Where else can I look?
:>
:>Thanks in advance for any pointers!
:>
:>----------------------------------------------------------------------
:>For IBM-MAIN subscribe / signoff / archive access instructions,
:>send email to [email protected]<mailto:[email protected]> with 
the message: INFO IBM-MAIN

--
Binyamin Dissen <[email protected]<mailto:[email protected]>>
http://www.dissensoftware.com<http://www.dissensoftware.com>

Director, Dissen Software, Bar & Grill - Israel

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

================================
Rocket Software, Inc. and subsidiaries ■ 77 Fourth Avenue, Waltham MA 02451 ■ 
Main Office Toll Free Number: +1 855.577.4323
Contact Customer Support: 
https://my.rocketsoftware.com/RocketCommunity/RCEmailSupport
Unsubscribe from Marketing Messages/Manage Your Subscription Preferences - 
http://www.rocketsoftware.com/manage-your-email-preferences
Privacy Policy - http://www.rocketsoftware.com/company/legal/privacy-policy
================================

This communication and any attachments may contain confidential information of 
Rocket Software, Inc. All unauthorized use, disclosure or distribution is 
prohibited. If you are not the intended recipient, please notify Rocket 
Software immediately and destroy all copies of this communication. Thank you.

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

Reply via email to