Earlier this month I asked about a way for an image to figure out what device and directory it exists in. It turns out that SYS$GETJPI can do this, if you request the JPI$_IMAGNAME item code. I knew about this item code but didn't even bother to try it because the documentation indicated that it gives back the filename (only) of the image, and not the entire device, directory, filename, extension and version. In fact it gives you everything. So DEC's routines worked as desired, but the documentation was a bit deficient. Thanks for the information to: David Kassover kassover@ra.crd.ge.com David L. Jones jones-d@eng.ohio-state.edu Bruce Haddad (?) akocoa.enet.dec.com::haddad Makoto Shimojima mako@uihepa.hep.uiuc.edu (Fortran code example, thanks) Rick Caldwell (Rick@seisvx.slb.sinet.com?) (Fortran code example, thanks) Matt Stum 00MJSTUM@bsu-ucs.bsu.edu Erland Sommarskog sommar@enea.se Richard B. Gilbert dragon@nscvax.princeton.edu A. Mahendra Rajah Mahendra@Meena.CC.URegina.CA Arne Vajhxj Internet: ISIS08@ECOSTAT.AAU.DK (Pascal code example, thanks) Carl J Lydick SOL1.GPS.CALTECH.EDU::carl (C code example, thanks) The shortest working code examples were from Carl and Arne in C and Pascal, respectively. Good stuff. My program of interest is written in Fortran, so I used the Fortran code example from Makoto, almost without modification, which follows. Thanks again everybody. PROGRAM Who_I_Am IMPLICIT NONE PARAMETER L = 255 CHARACTER*(L) ImagName INTEGER*4 Length INCLUDE '($JPIDEF)' STRUCTURE /JPI/ UNION MAP INTEGER*2 BufLen, ItemCode INTEGER*4 BufAddr, Return END MAP MAP INTEGER*4 End END MAP END UNION END STRUCTURE RECORD /JPI/ Item(1:2) INTEGER*4 Status, SYS$GETJPIW Item(1).BufLen = L Item(1).ItemCode = JPI$_IMAGNAME Item(1).BufAddr = %LOC(ImagName) Item(1).Return = %LOC(Length) Item(2).End = 0 Status = SYS$GETJPIW(,,,Item,,,) IF (.NOT. Status) CALL LIB$STOP(%VAL(Status)) WRITE (*, *) ImagName(: Length) END ____________________________________________________________________________ Harvey Brydon | SLB DECnet: ASL::BRYDON Schlumberger Anadrill | Internet: brydon@asl.sinet.slb.com 200 Macco Blvd | X.400: %RMS-E-RTB, Data Exceeds 65536 byte buffer Sugar Land, TX | FAX: (713)240-6546 77478 USA | P.O.T.S.: (713)274-8000 x8281 or 274-8281 (d.i.d.) "Live free or die" - on license plates made by convicts /* ---------- */