	SUBROUTINE OPNPUT(ITRANS,ICHAR)
	COMMON/OUTFIL/ILINE(512),IPOS,IOTSUM,IONYBL,NOREC,IFLG,LEN
	LOGICAL*1 INAME(30),ILINE
	DATA INAME/30*0/
C	  CHECK IF A FILE IS ALREADY OPEN - IF SO, THEN CLOSE IT
	IF((ITRANS.AND.1).EQ.0) GOTO 5
	CALL CLSFIL(1,ITRANS)
C
C	  SET UP A FILE TO RECEIVE DATA FROM THE UNIVAC
C
 5	TYPE *,' '
	IF((ITRANS.AND."100).EQ.0) TYPE *,'ASCII Data'
	IF((ITRANS.AND."100).NE.0) TYPE *,'Binary Data'
	IF((ITRANS.AND."40).NE.0) TYPE *,'8-Bit Mode'
	IF((ITRANS.AND.4).NE.0) TYPE *,'ECHO Mode'
	IF((ITRANS.AND."20).NE.0) TYPE *,'COPY Mode'
	WRITE(5,10) "15,"12
 10	FORMAT('$',2A1,'From REMOTE: (Filename)? ')
	DO 12 I=1,30
 12	INAME(I)=0
	CALL READST(INAME,LEN,29)
C	READ(5,13,ERR=19,END=19) LEN,INAME
C 13	FORMAT(Q,30A1)
	IF(LEN.LT.1) RETURN
C	INAME(30)=0
	IPOS=0
	IOTSUM=0
	IONYBL=0
	ITRANS=ITRANS + 1
	NOREC=1
C
C	  IF IN ASCII 7-BIT MODE, OPEN A SEQUENTIAL OUTPUT FILE
C
	IF((ITRANS.AND."140).EQ.0) GOTO 20
C	DEFINE FILE 7 (0,256,U,NOREC)
	OPEN(UNIT=7,NAME=INAME,ACCESS='DIRECT',TYPE='NEW',RECORDSIZE=128
     C		,BUFFERCOUNT=2,ERR=30)
 19	RETURN
C
C	  OPEN A SEQUENTIAL OUTPUT FILE
C
 20	OPEN(UNIT=7,NAME=INAME,ACCESS='SEQUENTIAL',TYPE='NEW',ERR=30,
     C		CARRIAGECONTROL='LIST')
	RETURN
C
C	  ERROR IN OPENING THE FILE
C
 30	TYPE *,' *** ERROR IN OPENING OUTPUT FILE ***'
	ITRANS=ITRANS.AND."177776
	RETURN
	END
