	REMARK	***************************************\
		*  P/R280.BAS   JOB FILE MAINTENANCE  *\
		*  5/17/79                   1:30 PM  *\
		***************************************

%INCLUDE CURSOR

	DIM S(1),R$(5),R1(2),R2(5),J(14),W(2),W1(2),W2$(2)
	DIM W2(14),G2$(5),G3(5),DATA$(2),KEY$(2)

	DEF FNEXACT(X0,X1)=X0*1000+X1					REMARK  KEY LOCATOR FUNCTION

	YES=1
	GOTO 6000

%INCLUDE SUBS1
%INCLUDE GENINFO

745	READ #1,X0;R$(1),R$(2),R$(3),R$(4),R$(5),R1(1),R1(2),\		REMARK  READ FIRST PART OF EMPLOYEE MASTER RECORD
	R2(1),R2(2),R2(3),R2(4),R2(5),R3$,S(1)
	RETURN


1000	Y2=2:RECORD.COUNT=JOB.RECORDS					REMARK  ROUTINES TO SEARCH JOB0F100.DAT AND JOBINPUT.DAT
	GOSUB 1060
	IF H <> -1 OR FINDNEXT%=YES THEN RETURN
1010	Y2=3:RECORD.COUNT=NEW.RECORDS%
	SEARCH.FAILURE%=0
	GOSUB 1060
	IF VAR1 <> INT(K/1000) THEN SEARCH.FAILURE%=YES
	RETURN



%INCLUDE PR-SEARC
%INCLUDE JOBFILE

3450	REMARK   ++++++++++++++++ALPHABETIC/NUMERIC DATA ENTRY+++++++++++++++


	X2$="****************************************************************"
	GOSUB 210:PRINT LEFT$(X2$,X2)
	CHAR%=LEAD.IN%:GOSUB 801
	CHAR%=ADDR.CURS%:GOSUB 801
	CHAR%=HORIZONTAL.TAB%:GOSUB 801
	CHAR%=NO.OF.LINEFEEDS%:GOSUB 801
	X0$=""

3500	IF CONSTAT% = 0 THEN GOTO 3500					REMARK  WAIT FOR OPERATOR TO ENTER CHARACTER
	X%=CONCHAR%
	IF X% <> 3 THEN GOTO 3505					REMARK  DISPLAY EXPLANATION MASK IF CTRL-C WAS HIT
	X0=12:GOSUB 260:PRINT:PRINT
3501	IF CONSTAT% THEN\
	X%=CONCHAR%:\
	X0=8:GOSUB 260:XY=X1:Z=1:GOSUB 4100:Z=0:GOSUB 4100:X1=XY:\	REMARK  IF A KEY WAS HIT, DISPLAY ENTRY MASK AND RETURN
	GOTO 3450\
	ELSE GOTO 3501


3505	IF X%=9 THEN GOTO 3450						REMARK  RESTART ENTRY IF CONTROL-I
	IF X%=0DH THEN GOTO 3700					REMARK  END DATA ENTRY IF <RETURN> WAS DEPRESSED
	IF X% >= 20H AND X% <= 7AH THEN GOTO 3600			REMARK  PROCESS AND VALID ASCII CHARACTER
	IF X% =7EH OR X% = 08H AND LEN(X0$) >= 1\
	THEN\
	CHAR%=BACKSPACE%:GOSUB 801:\
	CHAR%=42:GOSUB 801:\
	CHAR%=BACKSPACE%:GOSUB 801:\
	Z1%=LEN(X0$)-1:X0$=LEFT$(X0$,Z1%)				REMARK  TRUNCATE ENTRY STRING
	GOTO 3500
3600	IF LEN(X0$) < X2 THEN X0$=X0$+CHR$(X%)\				REMARK  IF ENTRY LENGTH WITHIN LIMITS, CONCATENATE
	ELSE\
	CHAR%=BACKSPACE%:GOSUB 801:\
	CHAR%=32:GOSUB 801:\
	CHAR%=BACKSPACE%:GOSUB 801
	GOTO 3500
3700	IF X3=0 AND X4=0 THEN RETURN
	X0 = VAL(X0$)
	IF MATCH("!",X0$,1) = 0 AND X0 >= X3 AND X0 <= X4 THEN RETURN	REMARK  PERFORM RANGE CHECKING:IF INVALID, REJECT
 3950	X2$="OUT OF RANGE"
	L1=X1
	GOSUB 615
	X1=L1
	GOTO 3450



4100	REMARK DISPLAY HEADER AND DETAIL RECORD VALUES

	IF Z=1\								REMARK  DISPLAY HEADER RECORD DATA IF Z IS SET TO 1
	THEN\
	X1=260:GOSUB 210:PRINT USING MASK6$;W(1):\			REMARK  DISPLAY JOB NUMBER
	X1=328:GOSUB 210:\
	PRINT W1$;TAB(64):\						REMARK  DISPLAY JOB DESCRIPTION
	X0=W1(1):X1=398:GOSUB 680:\					REMARK  DISPLAY JOB START AND END DATES
	X0=W1(2):X1=462:GOSUB 680:\
	PRINT:\
	X1=15:GOSUB 215:\
	PRINT W2$(1):\							REMARK  DISPLAY JOB STATUS AND TYPE CODES
	X1=15:GOSUB 215:\
	PRINT W2$(2):\
	RETURN


	IF Z=2 THEN\							REMARK  DISPLAY JOB TOTALS AFTER READING LAST DETAIL RECORD
	X1=277:GOSUB 210:\
	PRINT TAB(23);"JOB TOTALS";TAB(42):\
	PRINT:\
	FOR I1%=1 TO 7:\						REMARK  DISPLAY M-T-D AND J-T-D TOTALS FOR JOB DETAIL RECORDS
	Z2=J(I1%):\
	Z3=J(I1%+7):\
	GOSUB 4200:\
	NEXT I1%:\
	Z2=J(4)+J(5)+J(6)+J(7):\					REMARK  DISPLAY M-T-D AND J-T-D TOTAL OVERHEAD 
	Z3=J(11)+J(12)+J(13)+J(14):\
	GOSUB 4200:\
	Z2=Z2+J(3):\							REMARK  DISPLAY M-T-D AND J-T-D TOTAL COST-2
	Z3=Z3+J(10):\
	GOSUB 4200:\
	RETURN


	X1=277:GOSUB 210						REMARK  DISPLAY DETAIL RECORD DATA ON CRT

	X0=W(2):GOSUB 5460						REMARK  GET CORRESPONDING EMPLOYEE MASTER RECORD

	PRINT USING MASK6$;W(2);					REMARK  DISPLAY JOB NUMBER AND EMPLOYEE NAME
	PRINT "  ";R$(1);TAB(42)
	PRINT

	FOR I1%=1 TO 7							REMARK  DISPLAY M-T-D AND J-T-D COSTS AND OVERHEAD
	Z2=W2(I1%)
	Z3=W2(I1%+7)
	GOSUB 4200
	NEXT I1%

4120	Z2=W2(4)+W2(5)+W2(6)+W2(7)					REMARK  DISPLAY M-T-D AND J-T-D TOTAL OVERHEAD
	Z3=W2(11)+W2(12)+W2(13)+W2(14)
	GOSUB 4200
	Z2=Z2+W2(3)							REMARK DISPLAY M-T-D AND J-T-D TOTAL COST-2
	Z3=Z3+W2(10)
	GOSUB 4200
	RETURN


4200	PRINT								REMARK  DISPLAY A PAIR OF M-T-D AND J-T-D TOTALS ON CRT
	X1=40
	GOSUB 215
	PRINT USING MASKA$; Z2;
	X1=8:GOSUB 215
	PRINT USING MASKA$;Z3;
	RETURN


5300	X1=328:X2=56:X3=0:X4=0:GOSUB 3450				REMARK  ENTER JOB DESCRIPTION
	W1$=X0$
	GOTO 5350

5310	X1=270+C%*64:GOSUB 673						REMARK  ENTER START OR DUE DATES
	W1(C%-1) = X0
	GOTO 5350

5320	X1=270+C%*64:X2=1:X3=0:X4=9:GOSUB 3450				REMARK  CHANGE JOB STATUS OR TYPE CODES
	W2$(C%-3)=STR$(X0)
	GOTO 5350

5330	X1=103+C%*64:X2=9:X3=0:X4=999999.99:GOSUB 3450			REMARK  CHANGE M-T-D FIELDS ON DETAIL RECORDS
	W2(C%-5)=X0
	GOTO 5345

5340	X1=C%*64-329:X2=9:X3=0:X4=999999.99:GOSUB 3450			REMARK  CHANGE J-T-D FIELDS ON DETAIL RECORDS
	W2(C%-5)=X0

5345	X1=871:GOSUB 210						REMARK  DISPLAY NEW JOB DETAIL TOTALS ON CRT
	GOTO 4120

5350	IF O=1 THEN RETURN						REMARK  IF ANY HEADER FIELDS WERE CHANGED,
	X0=HEADER.LOCATION						REMARK  WRITE THE HEADER RECORD WITH CHANGES
	Y6=HEADER.FILE.ASSIGNMENT
	X9=W(2)
	W(2)=0
	GOSUB 1110
	W(2)=X9
	RETURN


5400	IF C% > 5 AND C% <= 12 THEN GOTO 5330				REMARK  THIS ROUTINE CALLS FIELD CHANGE ROUTINES
	IF C% > 12 AND C% <= 19 THEN GOTO 5340
	ON C% GOTO 5300,5310,5310,5320,5320

5460	IF X0=0 OR X0 > MSTR.RECORDS THEN S(1)=0:GOTO 5500		REMARK  READ EMPLOYEE MASTER FILE
	GOSUB 745
5500	IF S(1)=0 THEN R$(1)="NOT ON P/R MASTER"
	RETURN


6000	MASKA$="######.##"						REMARK  SET UP DISPLAY MASKS
	MASK6$="######"
	Y6=2
	Y8=3
	Y9=4
	OPEN "P/R0F110.DAT" RECL 1150 AS 1				REMARK  OPEN EMPLOYEE MASTER FILE
	OPEN "JOB0F100.DAT" RECL 160 AS Y6				REMARK  OPEN JOB FILE
	OPEN "G/I0F010.DAT" RECL 200 AS Y9:GOSUB 700			REMARK  OPEN AND LOAD GENERAL INFORMATION FILE
	OPEN "CRT" RECL 1100 AS 19

	CREATE "JOBINPUT.DAT" RECL 160 AS 3				REMARK  CREATE JOB INPUT FILE (FOR NEW JOBS)

6020	Z=3
	X0=8:GOSUB 260							REMARK  LOAD AND DISPLAY CRT MASK 9

	X2=1:X3=0:X4=2							REMARK  ENTER OPERATION CODE
	X2$="ENTER OPERATION (0=EXIT; 1=ADD; 2=CHANGE OR DELETE)":\
	GOSUB 665

	IF X0 = 0\							REMARK  IF OPERATION CODE=0, BRANCH TO MERGE ROUTINES
	THEN X1=64:GOSUB 210:\
	PRINT "WORKING... DO NOT INTERRUPT!";TAB(70):\
	GOTO 9000

	O=X0
	IF O=1 THEN GOTO 6200
6030	W(2)=0								REMARK  CHANGE OR DELETE JOBS IN THIS ROUTINE
	DIM J(14)
	X1=260:X2=6:X3=0:X4=999999:GOSUB 3450				REMARK  ENTER JOB NUMBER;IF ZERO, GET NEW OPERATION CODE
	IF X0=0 THEN GOTO 6020

	W2$(1)=""
	JOB.NO=X0							REMARK  SEARCH JOB FILE FOR HEADER RECORD
	EMP.NO=0
	K=FNEXACT(JOB.NO,0)
	GOSUB 1000
	IF H<>-1 THEN\
	HEADER.FILE.ASSIGNMENT=Y2:\
	HEADER.LOCATION=L:\
	Y6=Y2:X0=L:\
	GOSUB 1100

	IF H=-1 OR W2$(1)="D"\						REMARK  IF RECORD IS DELETED OR NONEXISTENT, FLASH ERROR
	THEN X2$="NOT ON FILE":GOSUB 615:GOTO 6030
	Z=1
	GOSUB 265
	GOSUB 4100							REMARK  DISPLAY JOB HEADER DATA

	DIM W2(14)							REMARK  INITIALIZE JOB TOTALS


6070	EMP.NO=EMP.NO+1							REMARK  SEARCH FOR THE NEXT LOGICALLY SEQUENTIAL RECORD
	FINDNEXT%=YES
	K=FNEXACT(JOB.NO,EMP.NO)
	GOSUB 1000

	IF VAR1 <> JOB.NO\						REMARK  SEARCH JOB INPUT FILE IF NOTHING FOUND ON JOB0F100
	AND SEARCH.FAILURE% <> YES\
	THEN GOSUB 1010

	IF VAR1 <> JOB.NO OR L>RECORD.COUNT THEN GOTO 6150		REMARK  IF NO MORE RECORDS FOR THIS JOB, BRANCH

	Y6=Y2:X0=L:GOSUB 1100						REMARK  READ THE DETAIL RECORD FROM DISK

	IF W2(3)=-1 THEN GOTO 6070					REMARK  SEARCH AGAIN IF DETAIL WAS LOGICALLY DELETED
	EMP.NO=W(2)
	DETAIL.LOCATION=L
	Z=0:GOSUB 4100							REMARK  DISPLAY DETAIL RECORD ON CRT
	LAST.FIELD%=19

6100	X2=2:X3=0:X4=99
	X2$="ENTER FIELD TO CHANGE(0=NONE;98=CHANGE JOB;99=DELETE)"	REMARK  PROMPT OPERATOR TO CHANGE DISPLAYED DATA
	GOSUB 665
	C%=X0
	IF C%=0 THEN 6130						REMARK  BRANCH BASED ON FIELD TO CHANGE
	IF C%=99 THEN 6160
	IF C%=98 THEN 6030
	IF C%>LAST.FIELD% THEN 6100
	GOSUB 5400
	GOTO 6100


6130	IF W(2)>0 THEN X0=DETAIL.LOCATION:GOSUB 1110			REMARK  SAVE DETAIL RECORD
	FOR I%=1 TO 14							REMARK  ACCUMULATE DETAIL FIELDS TO JOB TOTALS
	J(I%)=J(I%)+W2(I%)
	NEXT I%
	IF Z=2 THEN GOTO 6030 ELSE GOTO 6070


6150	Z=2:GOSUB 4100							REMARK  ALLOW CHANGES TO HEADER RECORD FIELDS
	LAST.FIELD%=5
	GOTO 6100

6160	IF Z<>0 THEN X2$="NOT ALLOWED":GOSUB 615:GOTO 6100		REMARK  DELETE A JOB DETAIL RECORD ONLY

	X2=3:X3=0:X4=0:X2$="ENTER DELETE CODE":GOSUB 665		REMARK  ENTER DELETE CODE
	IF X0$="DEL" THEN W2(3)=-1:X0=DETAIL.LOCATION:GOSUB 1110:\	REMARK  DELETE DETAIL RECORD IF CODE IS VALID
	X2$="RECORD DELETED":\
	GOSUB 615							REMARK  FLASH 'DELETED' BULLETIN TO OPERATOR
	GOTO 6070


6200	GOSUB 265							REMARK  ADD A JOB RECORD TO JOB INPUT FILE
	Z=3
	X1=260:X2=6:X3=0:X4=999999:GOSUB 3450				REMARK  ENTER JOB NUMBER
	IF X0=0 THEN 6020
	JOB.NO=X0
	FINDNEXT%=0
	K=FNEXACT(JOB.NO,0):GOSUB 1000					REMARK  SEARCH FOR A HEADER RECORD

	IF H =-1 THEN GOTO 6225						REMARK  CREATE HEADER RECORD IF NOT ALREADY ON FILE
	HEADER.FILE.ASSIGNMENT=Y2
	HEADER.LOCATION=L
	X0=L:Y6=Y2
	GOSUB 1100							REMARK  READ THE HEADER RECORD FROM DISK
	IF W2$(1)="D" THEN RE.USE.DELETED.RECORD=YES\
	ELSE Z=1:GOSUB 4100:GOTO 6232

6225	W(1)=JOB.NO:W(2)=0						REMARK  ENTER HEADER INFORMATION FOR NEW RECORD
	Z=1
	FOR C%=1 TO 5
	GOSUB 5400
	NEXT C%
	GOTO 6240							REMARK  ALLOW CHANGES TO ANY NEWLY-CREATED HEADERS


6230	GOSUB 265:Z=1:GOSUB 4100					REMARK  RE-DISPLAY HEADER INFORMATION ON CRT

6232	X1=280:X2=3:X3=0:X4=999:GOSUB 3450				REMARK  ENTER EMPLOYEE NUMBER FOR DETAIL RECORD

	IF X0=0 THEN 6200						REMARK  IF EMPLOYEE NUMBER=0, PROMPT FOR NEW JOB NUMBER
	W(2)=X0
	FINDNEXT%=0
	K=FNEXACT(W(1),X0):GOSUB 1000					REMARK  SEARCH JOB FILE FOR DUPLICATE DETAIL RECORD
	IF H=-1 THEN 6235
	X0=L
	Y6=Y2
	GOSUB 1100							REMARK  READ THE DETAIL RECORD & CHECK FOR DELETE CODE

	IF W2(3) <> -1 THEN X2$="ALREADY ON FILE":GOSUB 615:\		REMARK  IF RECORD WAS NOT DELETED, FLASH ERROR MESSAGE
	GOTO 6232

	DETAIL.LOCATION=L
	RE.USE.DELETED.RECORD=YES
	DETAIL.FILE.ASSIGNMENT=Y2
	
	
6235	X0=W(2)								REMARK  READ EMPLOYEE MASTER FOR THIS DETAIL RECORD
	GOSUB 5460
	X1=286:GOSUB 210
	PRINT R$(1)							REMARK  DISPLAY EMPLOYEE NAME
	Z=0
	C%=13
	DIM W2(14)							REMARK  INITIALIZE DETAIL AMOUNT FIELDS
	GOSUB 5400

6240	X2=2:X3=0:X4=99:\						REMARK  PROMPT OPERATOR TO CHANGE ENTERED DATA
	X2$="ENTER FIELD TO CHANGE(0=NONE; 99=CANCEL)":GOSUB 665
	C%=X0

	IF C%=99 THEN 6200						REMARK  IF 'CANCEL' SELECTED, GET A NEW JOB NUMBER
	IF C%=0 THEN GOTO 6250						REMARK  SAVE THE JOB RECORD IF NO CHANGES
	IF W(2) = 0 AND C% <= 5 THEN GOSUB 5400
	IF W(2) <> 0 AND C% >= 6 AND C% <= 19 THEN GOSUB 5400
	GOTO 6240



6250	X1=192:GOSUB 210:PRINT"WORKING... DO NOT INTERRUPT"
	IF RE.USE.DELETED.RECORD=YES AND W(2)=0\			REMARK  RE-USE DELETED RECORD SPACE IN ORDER TO KEEP
	THEN Y6=HEADER.FILE.ASSIGNMENT:\				REMARK  THE JOB FILE IN PERFECT ORDER FOR SEARCHING.
	X0=HEADER.LOCATION						REMARK  THIS PROCESS IS PERFORMED WHEN A DELETED
	IF RE.USE.DELETED.RECORD=YES AND W(2)<>0\			REMARK  RECORD WITH THE SAME RELATIVE POSITION AS THE
	THEN Y6=DETAIL.FILE.ASSIGNMENT:\				REMARK  'NEW' RECORD IS FOUND ON THE FILE.
	X0=DETAIL.LOCATION

	IF RE.USE.DELETED.RECORD=YES THEN\
	GOSUB 1110:\
	RE.USE.DELETED.RECORD=0:\
	GOTO 6230


6255	K=FNEXACT(W(1),W(2))						REMARK  FOR NEW RECORDS, FIND THE INSERTION POINT
	GOSUB 1000
	IF L>NEW.RECORDS% THEN GOTO 6274
	X%=L
	FOR I%=NEW.RECORDS% TO X% STEP -1				REMARK  EXPAND THE JOB INPUT FILE AT INSERTION POINT
	READ #3,I%;LINE X0$						REMARK  BY WRITING SUBSEQUENT RECORDS AT I+1,
	PRINT USING "&";#3,I%+1;X0$					REMARK  WHERE I IS THE ORIGINAL LOCATION OF THE RECORD.
	NEXT I%

6274	NEW.RECORDS%=NEW.RECORDS%+1					REMARK  INCREMENT NEW RECORD COUNT; WRITE NEWEST RECORD
	Y6=3:X0=L:GOSUB 1110

	CLOSE 3								REMARK  CLOSE AND RE-OPEN FILE TO SAVE FCB
	OPEN "JOBINPUT.DAT" RECL 160 AS 3

	GOTO 6230							REMARK  BRANCH BACK FOR ANOTHER DETAIL RECORD


9000	CLOSE 1,4,19							REMARK  START OF MERGE ROUTINE FOR JOB FILES
	IF JOB.RECORDS=0 THEN CLOSE 3:DELETE 2:\			REMARK  SKIP MERGE IF ONLY 'NEW' RECORDS EXIST
	OUTPUT.COUNT=NEW.RECORDS%:\
	A=RENAME("JOB0F100.DAT","JOBINPUT.DAT"):\
	GOTO 9550


	IF NEW.RECORDS% = 0 THEN\					REMARK  IF NO NEW RECORDS WERE ENTERED, SKIP MERGING
	DELETE 3:GOTO 9600


9035	CLOSE 2,3							REMARK  CLOSE JOB0F100.DAT AND JOBINPUT.DAT
	OPEN "JOB0F100.DAT" RECL 160 AS 1
	OPEN "JOBINPUT.DAT" RECL 160 AS 2

	CREATE "WORKFILE.DAT" RECL 160 AS 3				REMARK  CREATE WORK FILE FOR MERGE

	WRITTEN$=CHR$(0FFH)
	FOR I%=1 TO 6:WRITTEN$=WRITTEN$+WRITTEN$:NEXT I%		REMARK  SET UP A DEFAULT ABSOLUTE HIGH KEY

	ZERO$="000000"							REMARK  SET UP A ZERO-FILL STRING

	GOSUB 9100							REMARK  READ FIRST RECORDS FROM JOB0F100 AND JOBINPUT
	GOSUB 9110

9040	IF KEY$(1)=WRITTEN$ AND KEY$(2)=WRITTEN$\			REMARK  BRANCH TO WRAPUP ROUTINE IF NO MORE RECORDS
	THEN GOTO 9500

	IF KEY$(1)=WRITTEN$ THEN GOTO 9050				REMARK  SKIP COMPARISON IF JOB0F100.DAT IS LOWER

	IF KEY$(1) <= KEY$(2) THEN\					REMARK  WRITE JOB0F100.DAT RECORD IF IT IS LOWER
	PRINT USING "&";#3;DATA$(1):\
	OUTPUT.COUNT=OUTPUT.COUNT+1:\
	KEY$(1)=WRITTEN$:GOSUB 9100

9050	IF KEY$(2)=WRITTEN$ THEN GOTO 9040				REMARK  SKIP COMPARISON IF JOBINPUT.DAT IS EXHAUSTED

	IF KEY$(2) <= KEY$(1) THEN\					REMARK  WRITE JOBINPUT.DAT RECORD IF IT IS LOWER
	PRINT USING "&";#3;DATA$(2):\
	OUTPUT.COUNT=OUTPUT.COUNT+1:\
	KEY$(2)=WRITTEN$:GOSUB 9110

	GOTO 9040

9100	IF END #1 THEN 9101						REMARK  READ SEQUENTIALLY THROUGH JOB0F100.DAT
	READ #1;LINE DATA$(1)

	A%=MATCH(",",DATA$(1),1):B%=A%					REMARK  FORM A KEY FOR COMPARISON WITH JOBINPUT.DAT
	KEY$(1)=ZERO$+LEFT$(DATA$(1),(A%-1)):KEY$(1)=RIGHT$(KEY$(1),6)
	A%=MATCH(",",DATA$(1),B%+1)
	X0$=ZERO$+MID$(DATA$(1),B%+1,A%-B%-1):X0$=RIGHT$(X0$,3)
	KEY$(1)=KEY$(1)+X0$
	RETURN

9101	KEY$(1)=WRITTEN$						REMARK  SET 'RECORDS WRITTEN' FLAG
	RETURN


9110	IF END #2 THEN 9111						REMARK  READ SEQUENTIALLY THROUGH JOBINPUT.DAT
	READ #2;LINE DATA$(2)

	A%=MATCH(",",DATA$(2),1):B%=A%					REMARK  FORM A KEY FOR COMPARISON WITH JOB0F100.DAT
	KEY$(2)=ZERO$+LEFT$(DATA$(2),(A%-1)):KEY$(2)=RIGHT$(KEY$(2),6)
	A%=MATCH(",",DATA$(2),B%+1)
	X0$=ZERO$+MID$(DATA$(2),B%+1,A%-B%-1):X0$=RIGHT$(X0$,3)
	KEY$(2)=KEY$(2)+X0$
	RETURN

9111	KEY$(2)=WRITTEN$
	RETURN



9500	DELETE 1,2							REMARK  DELETE JOB0F100.DAT AND JOBINPUT.DAT
	CLOSE 3								REMARK  CLOSE THE WORK FILE
	A%=RENAME("JOB0F100.DAT","WORKFILE.DAT")			REMARK  CHANGE FILENAME TO NEW JOB0F100.DAT
9550	OPEN "G/I0F010.DAT" RECL 200 AS Y9				REMARK  UPDATE JOB FILE EXTENT ON G/I FILE
	JOB.RECORDS=OUTPUT.COUNT
	GOSUB 720

9600	PRINT CLEAR.SCREEN$;"JOB F/M LOADING MENU"			REMARK  TERMINATE PROGRAM AND LOAD MENU
	CHAIN "P/R000"


