	REMARK	**********************************************\
		*  P/R120.BAS  PAYROLL DEDUCTION FILE PRINT  *\
		*    5/16/79			 3:38 PM     *\
		**********************************************

	DIM G2$(5),G3(5)
%INCLUDE CURSOR
	GOTO 6000
%INCLUDE SUBS1
%INCLUDE GENINFO

									REMARK  ****  LINE PRINTER ROUTINE  ****
825	A1=65								REMARK  SET CARRIAGE WIDTH
	IF LINE.COUNT% < 55 THEN RETURN					REMARK  IF SPACE REMAINS ON REPORT PAGE, RETURN
	P=P+1
	PRINT CHR$(12);
830	PRINT TAB((A1-LEN(G2$(1)))/2);G2$(1);TAB(A1);"DATE ";		REMARK  PRINT COMPANY NAME AND DATE
	X0=G3(1):GOSUB 680.5
	PRINT
	PRINT TAB((A1-LEN(X4$))/2);X4$;TAB(A1);"PAGE ";P		REMARK  PRINT REPORT TITLE AND PAGE NUMBER
	PRINT
835	PRINT " EMPLOYEE  TR  TC  FREQ  DESCRIPTION     RATE    AMOUNT"
	PRINT
	LINE.COUNT%=6							REMARK  RESET LINE COUNTER FOR NEW REPORT PAGE
RETURN 
6000	MASKA$="   ######   #   #   ##   /123456789/    ##.##   ####.##"

	PRINT CLEAR.SCREEN$;"PAYROLL DEDUCTION PRINT"
	PRINT "(ENTER START EMPLOYEE NUMBER OF ZERO TO EXIT)"
	PRINT:PRINT
	PRINT"START EMPLOYEE NUMBER"
	PRINT"END EMPLOYEE NUMBER"
	X1=279:X2=3:X3=0:X4=999:GOSUB 345				REMARK  ENTER START EMPLOYEE NUMBER
	IF X0=0 THEN GOTO 6135						REMARK  END PROGRAM IF START EMPLOYEE NUMBER IS ZERO
	E1=X0
	X1=343:X2=3:X3=E1:X4=999:GOSUB 345				REMARK  ENTER ENDING EMPLOYEE NUMBER
	E2=X0
	X2$="ENTRY CORRECT?":X2=1:X3=0:X4=1:GOSUB 665			REMARK  VERIFY ENTRY:  '1'=O.K., '0'=RETRY
	IF X0 <> 1 THEN GOTO 6000
	Y9=2:OPEN "G/I0F010.DAT" RECL 200 AS Y9				REMARK  OPEN AND READ GENERAL INFORMATION FILE
	GOSUB 700
	Y3=1:OPEN "P/R0F030.DAT" RECL 38 AS Y3 BUFF 30 RECS 128		REMARK  OPEN PAYROLL DEDUCTION FILE
	X4$="P/R DEDUCTION FILE"
	LPRINTER							REMARK  SELECT PRINTER AS OUTPUT DEVICE
	LINE.COUNT%=60:GOSUB 825					REMARK  SKIP TO NEW PAGE AND PRINT HEADINGS
	IF END #Y3 THEN 6135						REMARK  SET END-OF-FILE BRANCH CONDITION
6070	READ #Y3;D1,D2,D3,D4,D1$,D5,D6
	IF D1 < E1 OR D1 > E2 THEN GOTO 6070				REMARK  IF EMPLOYEE NUMBER IS BELOW RANGE, GET NEXT
	IF D1 > E2 THEN GOTO 6135					REMARK  IF EMPLOYEE NUMBER IS PAST RANGE, EXIT ROUTINE

	GOSUB 825							REMARK  CHECK FOR END OF PAGE

	PRINT USING MASKA$;D1,D2,D3,D4,D1$,D5,D6;			REMARK  PRINT DEDUCTION FILE FIELDS

6090	IF D4>9 THEN 6130						REMARK  IF ACTIVE DEDUCTION, PRINT ASTERISKS TO RIGHT
	IF D4<3 THEN 6125
	IF D4<5 THEN 6130
	IF D4=5 AND G3(4)=1 THEN GOTO 6125
	IF G3(4)=2 THEN GOTO 6125
	GOTO 6130
6125	PRINT " *****";
6130	PRINT
	LINE.COUNT%=LINE.COUNT% + 1
	GOTO 6070
6135	CONSOLE								REMARK  END OF PROCESSING; LOAD MENU
	PRINT CLEAR.SCREEN$;"P/R DEDUCTION PRINT LOADING MENU"
	CHAIN "P/R000"
