/ 
/ 
/                   FIRST PRINTING, FEBRUARY 1974
/ 
/ THE INFORMATION IN THIS DOCUMENT IS SUBJECT TO 
/ CHANGE WITHOUT NOTICE AND SHOULD NOT BE CONSTRUED
/ AS A COMMITMENT BY DIGITAL EQUIPMENT CORPORATION.
/ DIGITAL EQUIPMENT CORPORATION ASSUMES NO RESPON-
/ SIBILITY FOR ANY ERRORS THAT MAY APPEAR IN THIS
/ DOCUMENT.
/ 
/ THE SOFTWARE DESCRIBED IN THIS DOCUMENT IS FUR-
/ NISHED TO THE PURCHASER UNDER A LICENSE FOR USE ON
/ A SINGLE COMPUTER SYSTEM AND CAN BE COPIED (WITH
/ INCLUSION OF DIGITAL'S COPYRIGHT NOTICE) ONLY FOR 
/ USE IN SUCH SYSTEM, EXCEPT AS MAY OTHERWISE BE PRO-
/ VIDED IN WRITING BY DIGITAL.
/ 
/ DIGITAL EQUIPMENT CORPORATION ASSUMES NO RESPONSIBILITY
/ FOR THE USE OR RELIABILITY OF ITS SOFTWARE ON EQUIP-
/ MENT THAT IS NOT SUPPLIED BY DIGITAL.
/ 
/ COPYRIGHT (C) 1974, BY DIGITAL EQUIPMENT CORPORATION
/ 
/ 
        .EJECT
/	EDIT #5
/
/ COPYRIGHT DIGITAL EQUIPMENT CORP., MAYNARD, MASS.
/
/			3/20/72		R. MCLEAN,W. DESIMONE
/
/	CLOSE -- FORTRAN CALLABLE SUBROUTINE TO CLOSE A FILE.
/
/	CALLING SEQUENCE:
/		CALL CLOSE (LUN,FN,EXT,IEV)
/		  LUN=LOGICAL UNIT NUMBER
/		  FN=FILE NAME
/		  EXT=FILE EXTENSION
/		  IEV=EVENT VARIABLE
/
	.GLOBL	CLOSE,.DAA,.FTSB
	.GLOBL .XFLRA,.CHKDL		/(FIOPS)
CLOSE	0
	JMS*	.DAA	/PICK UP CALLER'S ARGUMENTS
	JMP	ARGEND	/SKIP OVER ARGUMENTS
LUN	0
FLNM	0
EXT	0
EVNTV	0
ARGEND	LAC	EVNTV	/PICK UP EVENT VARIABLE ADDRESS
	DAC	REQEV	/AND SAVE IT IN REQUEST
	DZM	EVNTV	/CLEAR EVENT VARIABLE ADDRESS
	LAC*	LUN	/PICK UP LUN
	DAC	REQLUN
	LAC	FLNM	/FILENAME SPECIFIED?
	DAC	REQFLN	/USE TO ZERO FILENAME BUFFER
	DAC	REQFLN+1	/IN CASE NOT SPEC.
	SNA
	JMP	BY	/NO.  FORCE @@@@@@ FILE NAME.
	JMS*	.FTSB	/CONVERT FILENAME TO SIXBIT.
	FLNM
	REQFLN
BY	LAC	EXT	/FILENAME EXT SPECIFIED?
	DAC	REQEXT	/USE TO ZERO EXT. BUFF. IN CASE NOT SPEC.
	SNA
	JMP	BY1	/NO.  FORCE @@@ EXTENSION.
	JMS*	.FTSB
	EXT
	REQEXT
BY1	LAC	REQLUN	/FOR .XFLRA
	JMS*	.XFLRA	/RA FILE BEING PROC. ON THIS LUN?
	SKP		/YES.  DON'T ISSUE CLOSE.
	CAL	CLOSRQ
	LAC	REQLUN	/FOR .CHKDL
	JMS*	.CHKDL	/IF RA FILE BEING PROCESSED ON
			/THIS LUN, FILE WILL BE DELETED IF
			/A DEF. FILE AND DELETE SPEC. BY
			/CALL DEFINE.  IF SEQ. FILE BEING
			/PROCESSED, .CHKDL IS A NOP.
	DZM	FLNM	/OPTIONAL.  REINIT.
	DZM	EXT	/OPTIONAL  RENIT.
	JMP*	CLOSE
CLOSRQ	3400
REQEV	0
REQLUN	0
REQFLN	0		/FILENAME.
	0
REQEXT	0		/EXTENSION.
	0
	.END 	CLOSE
