[comp.lang.asm370] Where is the job number?

NAD100T@ODUVM.BITNET ("Nicholas A. D'Amato, Jr.", Tony) (07/18/89)

I'm trying to write a routine to return the current user's job name,
job number, procedure and step names. I am able to find all but the
job number with the following:

         L     R4,16                  CVT POINTER  (CVTPTR)
         L     R4,0(R4)               NEXT AND CURR TCB (CVTTCBP)
         L     R4,4(R4)               CURRENT TCB
         USING TCB,R4
         L     R5,TCBTIO              GET THE TIOT
         L     R6,TCBJSCB             GET THE JSCB
         USING TIOT,R5
         USING JSCB,R6
         MVC   JOBNAME,TIOCNJOB
         CLC   =CL8' ',TIOCSTEP+8     BLANKS?
         BE    MVCSTEP                THIS IS JOB STEP
         MVC   PROCNAME(8),TIOCSTEP
         MVC   STEPNAME(8),TIOCSTEP+8
         B     SKIP
MVCSTEP  DS    0H
         MVC   STEPNAME(8),TIOCSTEP
         MVC   PROCNAME(8),=CL8' '
SKIP     DS    0H

Is there anyone out there who can tell me where MVS stores the job number,
if anywhere? I am willing to bounce down JES control blocks, if necessary.
Thanks in advance!

|========================================================================|
| Nicholas A. (Tony) D'Amato, Jr.  | Snail-Mail: Old Dominion University |
| Computer Systems Engineer        |             Technical Support Group |
| E-Mail: NAD100T@ODUVM.BITNET     |             Computer Services       |
| -or-    nad100t@oduvm.cc.odu.edu |             128 Hughes Hall         |
| AT&T  : (804) 683-3189           |             Norfolk, VA 23529-0227  |
|                                  | Disclaimer: "I know nothing!"       |
|========================================================================|

LDW@USCMVSA.BITNET (Leonard D Woren) (07/18/89)

SSIBJBID looks like what you want.  Mapping macro is IEFJSSIB.
TCBJSCB -> JSCB, JSCBSSIB -> SSIB.

It's generally a bad idea to access JES2 control blocks from outside
of JES2, since they change with new releases of JES2, and you would
have to change all programs referencing them.


Leonard D. Woren
Senior MVS Systems Programmer
<LDW@USCMVSA.BITNET>  <LDW@MVSA.USC.EDU>
University of Southern California

XRJDM@SCFVM.BITNET (Joe McMahon) (07/18/89)

>
>I'm trying to write a routine to return the current user's job name,
>job number, procedure and step names. I am able to find all but the
>job number with the following...
>
The JES2 job number lives in the *JES2* JCT (not the one mapped out in
the debugging handbook).