From:	CRDGW2::CRDGW2::MRGATE::"SMTP::CRVAX.SRI.COM::RELAY-INFO-VAX" 28-JUN-1991 00:49:13.90
To:	ARISIA::EVERHART
CC:	
Subj:	Re: DEASSIGN from FORTRAN

From:	RELAY-INFO-VAX@CRVAX.SRI.COM@SMTP@CRDGW2
To:	Everhart@Arisia@MRGATE

Received:  by crdgw1.ge.com (5.57/GE 1.101)
	 id AA06815; Fri, 28 Jun 91 00:20:22 EDT
Received: From UCBVAX.BERKELEY.EDU by CRVAX.SRI.COM with TCP; Thu, 27 JUN 91 07:06:35 PDT
Received: by ucbvax.Berkeley.EDU (5.63/1.42)
	id AA25363; Thu, 27 Jun 91 06:54:32 -0700
Received: from USENET by ucbvax.Berkeley.EDU with netnews
	for info-vax@kl.sri.com (info-vax@kl.sri.com)
	(contact usenet@ucbvax.Berkeley.EDU if you have questions)
Date: 27 Jun 91 23:36:50 GMT
From: cis.ohio-state.edu!pacific.mps.ohio-state.edu!linac!uwm.edu!wuarchive!waikato.ac.nz!comp.vuw.ac.nz!gp.co.nz!zl2tnm!don@ucbvax.Berkeley.EDU  (Don Stokes)
Organization: Computer Archaeologists
Subject: Re: DEASSIGN from FORTRAN
Message-Id: <485742w163w@zl2tnm.gp.co.nz>
References: <1991Jun26.120730.402@beckman.com>
Sender: info-vax-request@kl.sri.com
To: info-vax@kl.sri.com

dsroberts@beckman.com writes:

> I need to deassign a logical from a process job table from FORTRAN.  It would
> appear LIB$DELETE_LOGICAL would do it, but how do I figure out the name of th
> job table for the process (this is being performed by the process the job tab
> belongs to, so no complications there).  Since LIB$DELETE_LOGICAL defaults to
> the process table I can't just leave it blank.  Is there a syntax for a 
> wildcard for this LIB$ function?  This would be rather out of character for 
> LIB$... 

Just feed it "LNM$JOB".  There's another process logical name "table"
called LNM$PROCESS_DIRECTORY which is looked up for logical name tables.
It contains the names LNM$GROUP (the name of your group table), LNM$JOB
(your job table) and LNM$PROCESS (points to LNM$PROCESS_TABLE, which
being located in process space rather than system space like the others,
doesn't need a unique extension added to it).

> I could parse together the job table name, I suppose.  Where does the number 
> in the job table name come from?  Is there a better way?

It's the JIB address.  This bit of MACRO code will display the name of
the job table for your job.  It requires CMEXEC privilege, since the PCB
is not user-mode readable.


                .library "SYS$LIBRARY:LIB"
		.link "SYS$SYSTEM:SYS.STB"/selective_search
		$PCBDEF

		.psect x_rw, long,noexe,noshr,wrt

jib_address:    .long                           ; Place to put JIB address
ctrstr:         .ascid "LNM$JOB_!XL"            ; FAO controll string
outbuf:         .ascid "LNM$JOB_xxxxxxxx"       ; Buffer to put name in

		.psect x_re, long,exe,shr,nowrt

		.entry x, ^m<>
;
; Jump into exec mode to retreive the JIB address, display the form of
; the job table name.
;
		$CMEXEC_S routin=getjib
		$FAO_S ctrstr=ctrstr, outbuf=outbuf, p1=jib_address
		pushaq outbuf
		calls #1, g^LIB$PUT_OUTPUT
		ret

;
; Exec mode code to get JIB address.  CTL$GL_PCB contains address of
; PCB.  PCB contains address of JIB, which is what we want.
;
		.entry getjib, ^m<>
		movl ctl$gl_pcb, R0
		movl pcb$l_jib(R0), jib_address
		movl #1, R0
		ret

		.end x

This is rather overkill compared to:

        $ write SYS$OUTPUT f$trnlnm("LNM$JOB", "LNM$PROCESS_DIRECTORY")

which of course requires no privilege whatsoever....  (but isn't
interesting!)


Don Stokes, ZL2TNM  /  /                             don@zl2tnm.gp.co.nz (home)
Systems Programmer /GP/ GP PRINT LIMITED  Wellington,       don@gp.co.nz (work)
__________________/  / ----------------   New_Zealand__________________________

