C     .TITLE ENDJOB SRC
C
C   8 SEP 77 (PDH) CALL CLOSE AFTER PRINTING TRAILER INFORMATION
C   9 MAR 77 (PDH) ADD DATE AND TIME TO '****END  # NNN'
C  17 DEC 76 (PDH) ALLOW 4 DIGIT JOB NUMBERS
C   8 OCT 76 - PAUL HENDERSON - SHORTEN THE OUTPUT CONSIDERABLY
C 
C 
C                   FIRST PRINTING, FEBRUARY 1974
C 
C THE INFORMATION IN THIS DOCUMENT IS SUBJECT TO 
C CHANGE WITHOUT NOTICE AND SHOULD NOT BE CONSTRUED
C AS A COMMITMENT BY DIGITAL EQUIPMENT CORPORATION.
C DIGITAL EQUIPMENT CORPORATION ASSUMES NO RESPON-
C SIBILITY FOR ANY ERRORS THAT MAY APPEAR IN THIS
C DOCUMENT.
C 
C THE SOFTWARE DESCRIBED IN THIS DOCUMENT IS FUR-
C NISHED TO THE PURCHASER UNDER A LICENSE FOR USE ON
C A SINGLE COMPUTER SYSTEM AND CAN BE COPIED (WITH
C INCLUSION OF DIGITAL'S COPYRIGHT NOTICE) ONLY FOR 
C USE IN SUCH SYSTEM, EXCEPT AS MAY OTHERWISE BE PRO-
C VIDED IN WRITING BY DIGITAL.
C 
C DIGITAL EQUIPMENT CORPORATION ASSUMES NO RESPONSIBILITY
C FOR THE USE OR RELIABILITY OF ITS SOFTWARE ON EQUIP-
C MENT THAT IS NOT SUPPLIED BY DIGITAL.
C 
C COPYRIGHT (C) 1974, BY DIGITAL EQUIPMENT CORPORATION
C 
C 
C	ENDJOB SRC  EDIT #3 1/30/74  G. COLE
C	COPYRIGHT DIGITAL EQUIPMENT CORP. 1973
	DOUBLE INTEGER M,FNAM,MON,BUF
	INTEGER D(6),RST,TST
	DIMENSION BUF(30),ACCNT(512),USR(400),FNAM(2),M(12)
	EQUIVALENCE (ACCNT(112),USR(1)),(JSN,ACCNT(1))
	EQUIVALENCE (JSR,ACCNT(3)),(JST,ACCNT(2))
	EQUIVALENCE (JXXX,ACCNT(4))
	DATA M(1),M(2),M(3),M(4)/'JAN','FEB','MAR','APR'/
	DATA M(5),M(6)/'MAY','JUN'/
	DATA M(7),M(8),M(9),M(10)/'JUL','AUG','SEP','OCT'/
	DATA M(11),M(12)/'NOV','DEC'/
	DATA CHARGF/10.0/
C
C
C
C
	CALL GETAF(ACCNT(1),IEV)
	IF(IEV.GT.0) GO TO 30
	WRITE(64,33) IEV
33	FORMAT(' *** FATAL ERROR ACCESSING ACCOUNT FILE ',I6,' ***')
	CALL XFC(BUF(1),60,IEV)
	CALL GETDV
	CALL EXIT
30	CONTINUE
	CALL XFC(BUF(1),60,IEV)
	CALL DATE(D)
	IM=D(1)
	IDAY=D(2)
	IYER=D(3)
	IHOR=D(4)
	IMIN=D(5)
	ISEC=D(6)
	IST=IHOR*3600+IMIN*60+ISEC
	MON=M(IM)
	IF(JXXX.EQ.101010) GO TO 300
	DO 400 I=1,512
400	ACCNT(I)=0
	JXXX=101010
300	CONTINUE
	IF(JSR.NE.0) GO TO 900
111	IF(IEV.GT.0) CALL GETDV
	CALL EXIT
900	RST=IST-JST
	CALL CANTLE
	IF(RST.GT.0) GO TO 901
	RST=((24*3600)-JST)+IST
901	USR(JSR)[18:35]=USR(JSR)[18:35]+RST
	TST=USR(JSR)[18:35]
	COST=(FLOAT(RST)/3600.)*CHARGF
	WRITE(64,150)JSN,IDAY,MON,IYER,IHOR,IMIN,ISEC
150	FORMAT(' ***END  #',I4,I3,1XA3,I3,I4,':',I2,':',I2)
	WRITE(16,102) JSN,IDAY,MON,IYER,IHOR,IMIN,ISEC,
	1 JSR,RST,COST,TST
      CALL CLOSE (16)
	JSR=0
	CALL PUTAF
	GO TO 111
102   FORMAT (//,'****************************************',
     * '****************************************  END OF JOB NUMBER',
     * I5,//,I3,1XA3,I3,I4,2(':',I2),'  ACCOUNT NUMBER',
     * I4,';  RUNNING TIME',I6,' SEC;  COST OF RUN $',
     * F5.2,';  TIME USED TO DATE',I6,' SEC.')
	END
