From:	CSBVAX::MRGATE!INFO-VAX-RELAY@KL.sri.com@SMTP 27-JUL-1988 10:38
To:	ARISIA::EVERHART
Subj:	RE: Location Of a Running Program...


Received: from VAX1.CC.LEHIGH.EDU by KL.sri.com with TCP; Thu, 21 Jul 88 07:39:41 PDT
Date: Thu, 21 Jul 88 10:33 EST
From: STEVE ROSEMAN <LUSGR@VAX1.CC.LEHIGH.EDU>
Subject: RE: Location Of a Running Program...
To: INFO-VAX@KL.SRI.COM
X-VMS-To: IN%"INFO-VAX@KL.SRI.COM"

> From: CS117030%YUSOL.BITNET@IBM1.CC.LEHIGH.EDU
> Subject: Location Of a Running Program...


>        I would like to know if there is any way that you could find
>     the location of a running program on the disk, because i would
>     like to put this code in a high level language program, and when
>     I run the program, it should give me the location where the
>     actual program is been stored, regardless of my default location.

Here is the beginning of a subroutine I use for that purpose.

Steve Roseman
Lehigh University.

-------

      SUBROUTINE PS_INIT
C
C..   INITIALIZATION OF OUTPUT FILE (PROLOG)
C
      CHARACTER UN*12, NODE*20, CDATE*10, CTIME*10, IMAGE*39
      include '($jpidef)'
C
      REWIND 99
1     FORMAT(A)
      WRITE(99,1) '%!PS-Adobe-1.0'
      WRITE(99,1) '%%DocumentFonts: Courier '
      WRITE(99,1) '%%Title: LUCC VAX/VMS Plot V1.0'
      j = lib$getjpi(jpi$_imagname,,,,image,i1)
      WRITE(99,1) '%%Creator: '//image(:i1)
