Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

JIB Jab

12 views
Skip to first unread message

VAXman-

unread,
Oct 13, 2009, 12:46:45 PM10/13/09
to
Here's one for you all to ponder since there's little VMS talk here of late.

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?"

Verne

unread,
Oct 13, 2009, 2:34:26 PM10/13/09
to


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

VAXman-

unread,
Oct 13, 2009, 3:22:46 PM10/13/09
to
In article <a7ee5e2e-902c-4811...@a21g2000yqc.googlegroups.com>, Verne <ve...@wvnet.edu> writes:
>On Oct 13, 12:46=A0pm, VAXman- @SendSpamHere.ORG wrote:
>> Here's one for you all to ponder since there's little VMS talk here of la=
>te.
>>
>> How do you get the JIB from the PID using DCL such that you can see the J=
>OB
>> logical table of the process whose PID you've specified. =A0Have fun...
>>
>> --
>> VAXman- A Bored Certified VMS Kernel Mode Hacker =A0 =A0VAXman(at)TMESIS(=
>dot)ORG
>>
>> =A0http://www.quirkfactory.com/popart/asskey/eqn2.png
>>
>> =A0 "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 =3D=3D "$PAGE_C:[003]GETJOB.ALPHA_EXE"

>getjob 'f$integer(%x1B37DC57)' xyz
>SHOW SYMBOL xyz
>XYZ =3D "LNM$JOB_82DE6580"
>
>wiil that do ??

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.

Tim E. Sneddon

unread,
Oct 13, 2009, 8:48:37 PM10/13/09
to
VAXman- @SendSpamHere.ORG wrote:
> Here's one for you all to ponder since there's little VMS talk here of late.
>
> 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...
>

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.

Craig A. Berry

unread,
Oct 13, 2009, 11:02:09 PM10/13/09
to

That seems like a lot of work. How about:

$ show log/structure lnm$job
"LNM$JOB" = "LNM$JOB_886E6300" (LNM$PROCESS_DIRECTORY)

Tim E. Sneddon

unread,
Oct 13, 2009, 11:18:07 PM10/13/09
to

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.

VAXman-

unread,
Oct 14, 2009, 7:57:23 AM10/14/09
to

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.

VAXman-

unread,
Oct 14, 2009, 8:02:29 AM10/14/09
to

If you can make that work for a process other then your own, do let us know.

0 new messages