	SUBROUTINE OPNPR(lo,li,lp,defname,ncol,nlines)
	INTEGER lo,li,lp
	character*(*) defname
C---------------------------------------------------------------------------
C Subroutine to open the printer
C	ncol = number of columns on line 
C	nlines = number of lines per page
C---------------------------------------------------------------------------
	CHARACTER*11 LGPRC/'LNM$PROCESS'/
c	CHARACTER*7 LGJOB/'LNM$JOB'/
	LOGICAL GET_LOGICAL,flag,def_logical
	CHARACTER P_FILE*50,P_STRING*60
	INTEGER P_len,LN
 
	Ncol = 132
	nlines = 60
C get logical definition for the printer
	flag = GET_LOGICAL('PS_PFILE',P_FILE,50,P_len,lgprc)
	if (P_len .eq. 0) then
	  P_file = 'ps_tmp:'
	  P_LEN = 7
	endif
	OPEN(unit=lp,file=P_FILE(1:P_len),defaultfile=defname,
	1	status='new')
C now get the name of the file and define it as a logical name
C save them 
	inquire(file=P_FILE,defaultfile=defname,name=P_STRING)
	CALL PRESS(p_STRING,LN)
	flag = DEF_LOGICAL('PS_PR_LAST',P_STRING(1:LN),LN,1,lgprc)
	RETURN
	END
C---------------------------------------------------------------------------
	SUBROUTINE CLPR(lo,li,lp)
	INTEGER lo,li,lp
C---------------------------------------------------------------------------
C Subroutine to close the hard printer output file and possibly spool the
C output.  Logical name PS_PR_LAST is defined with the output file name.
C---------------------------------------------------------------------------
	CHARACTER*11 LGPRC/'LNM$PROCESS'/
C	CHARACTER*7 LGJOB/'LNM$JOB'/
	LOGICAL GET_LOGICAL,flag,lib$spawn
	CHARACTER P_COM*200
	INTEGER P_len

	close(unit=lp) 
C check for a command to process the file
	flag = GET_LOGICAL('PS_PCOM',P_COM,200,P_len,lgprc)
C now queue the file, if PS_PCOM has been defined
	if (P_len .le. 0) return
	flag = lib$spawn(P_com(1:P_len))
	if (flag) RETURN
	write(lo,'(A)') ' WARNING: unable to queue file to print',
	1	'    press RETURN to continue'
	read (li,'(A)') ians
	return	
	END
