	SUBROUTINE GET_IMAGENAME (IMAGENAME)
	IMPLICIT NONE
	CHARACTER*(*)	IMAGENAME
C******************************************************************************
C***
C***	This routine gets the name of the current executing image.
C***
C***	PARAMETERS :
C***
C***		IMAGENAME	(C*?)	Output current executing image name.
C***
C***	Author :	Jeff Cameron
C***
C***	Modification history :
C***
C***	Programmer	Date		Description
C*** ----------------------------------------------------------------------
C***	Jeff Cameron	19-DEB-1996	Initially written
C*** ----------------------------------------------------------------------
C*** Hi Gooma!
C******************************************************************************
C
C***	Constants
	INCLUDE		'($JPIDEF)'
C
C***	Common blocks
C
C***	Local declarations
	INTEGER*4	ISTAT,SIZE
	INTEGER*4	ITMLST (3)
	INTEGER*2	ITLST (2)
	EQUIVALENCE	(ITMLST,ITLST)
C
C***	Externals
	INTEGER*4	SYS$GETJPIW
	EXTERNAL	SYS$GETJPIW
C
C***	Formats
C------------------------------------------------------------------------------
C
C***	Begining of executable code.
	ITLST(1) = LEN (IMAGENAME)
	ITLST(2) = JPI$_IMAGNAME
	ITMLST (2) = %LOC (IMAGENAME)
	ITMLST (3) = %LOC (SIZE)
C
	ISTAT = SYS$GETJPIW (,,,ITMLST,,,)
	IF (.NOT. ISTAT) CALL SYS_SIGNAL (ISTAT)
C
C***	All done
	RETURN
	END
