How do you get the JIB from the PID using DCL such that you can see the JOB
logical table of the process whose PID you've specified. Have fun...
--
VAXman- A Bored Certified VMS Kernel Mode Hacker VAXman(at)TMESIS(dot)ORG
http://www.quirkfactory.com/popart/asskey/eqn2.png
"Well my son, life is like a beanstalk, isn't it?"
you say "using DCL" ... I do have a macro routine that I call from a
wrapper program in Basic (Vax, Alpha and IA64 versions) that when
given
a PID, will look it up and create a symbol containing a string
like LNM$JOB_82DE6580 ... got help on writing this from several
people,
not something I was able to figure out on my own :-)
GETJOB == "$PAGE_C:[003]GETJOB.ALPHA_EXE"
getjob 'f$integer(%x1B37DC57)' xyz
SHOW SYMBOL xyz
XYZ = "LNM$JOB_82DE6580"
wiil that do ??
Verne Britton, WVNET
I could write such a program in my sleep.
.LIBRARY "SYS$LIBRARY:LIB.MLB"
$PCBDEF
$SSDEF
$OFFSET 0,POSITIVE,<-
<ARGCNT,4>,-
<THEPID,4>,-
<THEJIB,4>,>
.WEAK EXE$EPID_TO_PCB,EXE$CVT_EPID_TO_PCB
.PSECT DATA,WRT,NOEXE,5
ARGLST: .LONG 2
.ADDRESS PID
.ADDRESS JIB
PID: .LONG 0
JIB: .LONG 0
.PSECT CODE,NOWRT,EXE,5
.ENTRY GETJOB,0
;
; get command line params ... I'd probably use .CLD and CLI$rouintes
;
MOVL cmdline-pid,PID
$CMKRNL_S routin = GETJIB,-
arglst = ARGLST
;
; check status
; create DCL symbol (not so sure I'd do this either but...
;
RET
.ENTRY GETJIB,0
MOVL @THEPID(AP),R0
PUSHL #<EXE$EPID_TO_PCB!EXE$CVT_EPID_TO_PCB>
JSB @(SP)+
TSTL R0
BEQL badPID
MOVL PCB$L_JIB(R0),@THEJIB(AP)
MOVL #SS$_NORMAL,R0
RET
badPID: MOVL #SS$_NONEXPR,R0
RET
.END GETJOB
The question was to get it in DCL. No escape hatch to a $CMKRNL hack.
Here is my entry:
pooky_FTA8> type jib.com
$ set noon
$ on warning then goto bail_out
$ on control_y then goto bail_out
$
$ say = "write sys$output"
$
$ p1 = f$edit(p1,"TRIM,UNCOMMENT,COLLAPSE,UNCOMMENT")
$ if (p1 .eqs. "") then p1 = f$getjpi("","PID")
$
$ pipe say "show process/id=''p1'" -
| analyze/system -
| search sys$pipe "JIB" -
| ( read sys$pipe result ; -
define/job/nolog pipe_result &result )
$
$ jibadr = f$element(5," ",f$edit(f$trnlnm("PIPE_RESULT"),"COMPRESS,TRIM"))
$
$ say "The job table for process ''p1' is LNM$JOB_''jibadr'"
$
$bail_out:
$ exitt 1
pooky_FTA8> jib
The job table for process 0000046D is LNM$JOB_884F9D00
Tim.
That seems like a lot of work. How about:
$ show log/structure lnm$job
"LNM$JOB" = "LNM$JOB_886E6300" (LNM$PROCESS_DIRECTORY)
But the challenge was for any PID. My procedure simply defaults
to the current process (as do most system services, etc. that
deal with process specific information).
If you supply any PID as argument P1 my procedure will track down
its job logical table name.
Tim.
Yeah Tim, I believe that escape to SDA is the only way. I don't understand
why the $GETJPI system service doesn't have the JIB as one of its item list
codes.
If you can make that work for a process other then your own, do let us know.