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	ACI SRC   EDIT #2  1/30/74  G. COLE
C	COPYRIGHT DIGITAL EQUIPMENT CORP. 1973
C
C	RSX-PLUS BATCH PROCESSING SYSTEM
C	ACCOUNT FILE INITIALIZATION PROGRAM
C
C	THIS SHOULD BE TASK BUILT INTO A TASK NAMED ...ACI
C	AND RUN AS AN MCR FUNCTION TASK
C	IT WILL REQUIRE A LARGER PARTITION OF COURSE
C	THIS PROGRAM WILL INTITALIZE THE ACCOUNTING INFORMATION FILE
C	'USERS RSX' WHICH IS MAINTAINED DURING BATCH PROCESSING
C
C	SINCE THIS INITIALIZATION COULD DESTROY VALUABLE INFORMATION
C	IT CAN ONLY BE DONE BY ENTERING A PASSWORD.
C	THE PASSWORD IS SPECIFIED IN A DATA STATEMENT IN THIS
C	PROGRAM.
C
C
C	WHEN A VALID PASSWORD IS ENTERED ACI INITIALIZES THE 
C	ACCOUNTING FILE AND PRINTS OUT 'INITIALIZED'
C	IF AND INVALID PASSWORD IS ENTERED ACI PRINTS OUT
C	'INVALID -- EXIT' IN BOTH CASES THE PRINTOUT  OVER WRITES
C	YOUR TYPIN OF THE PASSWORD.
C
C
C	THREE PROGRAMS USE THE ACCOUNT FILE IN ADDITION TO ACI
C	THESE ARE
C	JOB...   THE JOBSTARTUP PROCESSOR
C	END...	THE JOB TERMINATION PROCESSOR
C	...ACD  THE ACCOUNT FILE SUMMARY PROCESSOR
C
C
C
	DOUBLE INTEGER FNAM,ACCNT,PASSW,PASS
	INTEGER JPDATE(6)
	DIMENSION ACCNT(512),FNAM(2),USR(400)
	EQUIVALENCE (JXXX,ACCNT(4))
	EQUIVALENCE (JSN,ACCNT(1))
	EQUIVALENCE (JPDATE(1),ACCNT(5))
	EQUIVALENCE (USR(1),ACCNT(112))
	DATA PASSW/'RSX'/
	CALL GETAF(ACCNT(1),IEV)
	IF(IEV.LT.0) GOTO 30
	WRITE(2,10)
	READ(2,11) PASS
	IF(PASS.NE.PASSW) GOTO 20
10	FORMAT(' RSX-PLUS ACCOUNT INITIALIZATION'/' ENTER PASSWORD:')
11	FORMAT(A3)
	WRITE(2,15)
	WRITE(2,16)
	READ(2,11) ASW
	IF(ASW.EQ.3HYES) GOTO 50
	IF(ASW.NE.2HNO) GOTO 20
70	WRITE(2,17)
	READ(2,) IAC
	IF(IAC.EQ.0) GOTO 60
	IF(IAC.GT.99) GOTO 20
	IRNS1=USR(IAC)[0:17]
	ITIM1=USR(IAC)[18:35]
	WRITE(2,19) IRNS1,ITIM1
	READ(2,) IRNS,ITIM
	USR(IAC)[0:17]=IRNS
	USR(IAC)[18:35]=ITIM
	GOTO 70
60	CONTINUE
	JSN=0
	DO 500 K=1,99
500	JSN=JSN+USR(K)[0:17]
	CALL PUTAF
	WRITE(2,21)
	CALL REQMCR
	CALL EXIT
15	FORMAT('+&&&'/'+%%% ACCEPTED')
16	FORMAT(' RESET ALL ACCOUNTS (YES/NO) ? ')
17	FORMAT(' ACCOUNT NUMBER TO BE EDITED, ENTER 0 IF DONE')
19	FORMAT(' CURRENT: RUNS',I5,'  TIME',I7/' ENTER NEW VALUES')
21	FORMAT(' ACCOUNT FILE EDITED'/)
50	DO 101 I=1,512
101	ACCNT(I)=0
	JXXX=101010
	CALL DATE(JPDATE)
	CALL PUTAF
	WRITE(2,12)
12	FORMAT(' ACCOUNTS INITIALIZED')
	CALL REQMCR
	CALL EXIT
20	WRITE(2,13)
13	FORMAT('+&&&'/'+%%% INVALID -- EXIT')
	CALL REQMCR
	CALL EXIT
30	WRITE(2,14) IEV
14	FORMAT(' FATAL ERROR -- EXIT ',I6)
	CALL REQMCR
	CALL EXIT
	END
