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,SIDE,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)/'JLY','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) GOTO 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)
	SIDE='AM'
	IF(IHOR.LT.13) GOTO 200
	IHOR=IHOR-12
	SIDE='PM'
200	CONTINUE
	IF(JXXX.EQ.101010) GOTO 300
	DO 400 I=1,512
400	ACCNT(I)=0
	JXXX=101010
300	CONTINUE
	IF(JSR.NE.0) GOTO 900
111	IF(IEV.GT.0) CALL GETDV
	CALL EXIT
900	RST=IST-JST
	CALL CANTLE
	IF(RST.GT.0) GOTO 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
150	FORMAT(' ***END #',I4)
	WRITE(16,102) JSN,MON,IDAY,IYER,IHOR,IMIN,ISEC,SIDE,
	1 JSR,RST,COST,TST
	JSR=0
	CALL PUTAF
	GOTO 111
101	FORMAT(1H1,10(T10,'RSX/BATCH'//),T10,'RSX/BATCH',T60,
	1 'PDP15 COMPUTER SYSTEM   JOB'
	1 ,' NUMBER ',I4//T10,'RSX/BATCH',T60,A3,2X,I3,', 19',I2,' AT ',
	2 I3,':',I2,':',I2,1X,A2//T10,'RSX/BATCH'//T10,'RSX/BATCH',
	3 T60,12A5//T10,'RSX/BATCH'//T10,'RSX/BATCH',T60,'ACCOUNT NUMBER',
	4 T80,I4//T10,'RSX/BATCH',T60,'RUN NUMBER',T80,I4//
	5 15(T10,'RSX/BATCH'//),1H1)
C
C
102	FORMAT(1H1,10(T10,'RSX/BATCH'//),T10,'RSX/BATCH',T60,
	1 'PDP15 COMPUTER SYSTEM  END OF JOB NUMBER ',I4//T10,'RSX/BATCH'
	2 ,T60,A3,1X,I3,', 19',I2,'  AT ',I3,':',I2,':',I2,1X,A2//
	3 T10,'RSX/BATCH'//T10,'RSX/BATCH',T60,'***** ACCOUNTING ',
	4 'INFORMATION *****'//T10,'RSX/BATCH'//T10,'RSX/BATCH',
	5 T60,'ACCOUNT NUMBER',T80,I4//T10,'RSX/BATCH',T60,
	6 'RUNNING TIME',T78,I6,' SEC'//T10,'RSX/BATCH',T60,
	7 'COST OF RUN',T78,1H$,F5.2//T10,'RSX/BATCH',T60,
	8 'TIME USED TO DATE',T78,I6,' SEC'//
	9 13(T10,'RSX/BATCH'//),1H1)
	END
