	INTEGER LABEL,MODE,JUMP,FILE,FLAG,ANSWER,IFLAG(99),TARGET
	REAL TEXT(12),UPDATE(2),SGEN(2)
	REAL UPDAT2(2),PIP2(2),PIP3(2),MACRO(2),MAC11(2),PATCH(2),CODE(2)
	DATA UPDAT2,PIP2/'UPDAT','2BAT ','PIP2 ',' BAT '/
	DATA PIP3,MACRO/'PIP3 ',' BAT ','MACRO',' BAT '/
	DATA MAC11,PATCH/'MAC11',' BAT ','PATCH',' BAT '/
	DATA CODE,UPDATE/'CODE ',' SRC ','UPDAT','EBAT '/
	DATA BLANK/5H     /
	DATA SGEN/'SGEN ',' BAT '/
	CALL SEEK(1,CODE)
	CALL ENTER(2,UPDAT2)
	CALL ENTER(3,PIP2)
	CALL ENTER(4,PIP3)
	CALL ENTER(5,MACRO)
	CALL ENTER(6,MAC11)
	CALL ENTER(7,PATCH)
	CALL ENTER(8,UPDATE)
	CALL ENTER(9,SGEN)
	WRITE(2,12)
	WRITE(3,13)
	WRITE(4,14)
	WRITE(5,15)
	WRITE(6,16)
	WRITE(7,17)
	WRITE(8,18)
	WRITE(9,19)
10	FORMAT(1X,12A5)
110	FORMAT(1X,'ERROR - UNSATISFIED JUMP TO ',I3)
12	FORMAT('$JOB UPDAT2')
13	FORMAT('$JOB PIP2')
14	FORMAT('$JOB PIP3')
15	FORMAT('$JOB MACRO')
16	FORMAT('$JOB MAC11')
17	FORMAT('$JOB PATCH')
18	FORMAT('$JOB UPDATE')
19	FORMAT('$JOB SGEN')
101	FORMAT(I3,1X,I2,1X,I3,1X,I2,1X,I2,1X,12A5)
201	FORMAT(12A5,20X)
	CALL SYSDEV(IFLAG(99))
1001	READ(1,101,END=2001)LABEL,MODE,JUMP,FILE,FLAG,TEXT
20	GOTO(1,2,3,4,5,6,7,8,9,90,91),MODE
30	TARGET=JUMP
3001	READ(1,101,END=4001)LABEL,MODE,JUMP,FILE,FLAG,TEXT
	IF(LABEL.EQ.TARGET)GOTO 20
	GOTO 3001
1	CONTINUE
C	OUTPUT TEXT TO TTY
	CALL TTOUT(TEXT,12)
	GOTO 1001
2	CONTINUE
C	Y/N ROUTINE (YES PROCEED/NO JUMP)
	CALL TTOUT(TEXT,12)
	CALL REPLY(ANSWER)
	GOTO(1001,30),ANSWER
3	CONTINUE
C	Y/N ROUTINE (NO PROCEED/YES JUMP)
	CALL TTOUT(TEXT,12)
	CALL REPLY(ANSWER)
	GOTO(30,1001),ANSWER
4	CONTINUE
C	OUTPUT TEXT TO FILE "FILE"
	DO 104 I=0,12
	IF(TEXT(12-I).NE.BLANK)GOTO 204
104	CONTINUE
	GOTO 304
204	IF(I.EQ.0)GOTO 304
	TEXT(13-I)[0:6]=#15
304	WRITE(FILE,201)TEXT
	GOTO 1001
5	CONTINUE
C	JUMP TO LABEL
	GOTO 30
6	CONTINUE
C	SET FLAG WITH VALUE 'FILE'
	IFLAG(FLAG)=FILE
	GOTO 1001
7	CONTINUE
C	TEST FLAG AND JUMP IF VALUE NE 'FILE'
	IF(IFLAG(FLAG).NE.FILE)GOTO 30
	GOTO 1001
8	CONTINUE
C	TEST FLAG AND JUMP IF VALUE EQ 'FILE'
	IF(IFLAG(FLAG).EQ.FILE)GOTO 30
	GOTO 1001
9	CONTINUE
C	BACK UP TO LABEL
	REWIND 1
	GOTO 30
90	CONTINUE
C	INCREMENT FLAG "FLAG" AND TEST VALUE "FILE" OUTPUT FILE "JUMP" IF EQ
	IFLAG(FLAG)=IFLAG(FLAG)+1
	IF(IFLAG(FLAG).NE.FILE)GOTO 1001
	FILE=JUMP
	GOTO 4
91	CONTINUE
C	INCREMENT FLAG "FLAG" AND TEST VALUE "FILE" JUMP TO "JUMP" IF EQ
	IFLAG(FLAG)=IFLAG(FLAG)+1
	IF(IFLAG(FLAG).EQ.FILE)GOTO 30
	GOTO 1001
4001	WRITE(10,110)TARGET
2001	ENDFILE 2
	ENDFILE 3
	ENDFILE 4
	ENDFILE 5
	ENDFILE 6
	ENDFILE 7
	ENDFILE 8
	ENDFILE 9
	STOP
	END
