	REMARK	*********************************\
		*  P/R250.BAS  INSURANCE REPORT *\
		*    5/17/79           1:25 PM  *\
		*********************************
%INCLUDE CURSOR
	DIM G2$(5),G3(5)
	DIM S(96),R$(5),R1(2),R2(5),A(2),E(2),C1(100),C2(100)
	GOTO 6000
%INCLUDE SUBS1
%INCLUDE GENINFO
%INCLUDE MSTRIN
825	A1=51								REMARK  ****    LINE PRINTER ROUTINE    ****

	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" CLASS  TOTAL EARNINGS   EXEMPT EARNINGS         NET"
	PRINT
	LINE.COUNT%=6							REMARK  SET LINE COUNTER FOR NEW REPORT PAGE
	RETURN 
6000	DEF FNR(Z1)=INT(Z1*100+.5)/100
	MASKA$=" #####      #######.##        #######.##  #######.##"	REMARK  SET UP PRINT MASKS
	MASKB$=" /12345/    #######.##        #######.##  #######.##"
	PRINT CLEAR.SCREEN$;"P/R INSURANCE REPORT"
	PRINT "KEY RETURN TO BEGIN; CTRL-C TO EXIT"
6000.1	IF CONSTAT%=0 THEN GOTO 6000.1 ELSE A%=CONCHAR%			REMARK  POLL KEYBOARD FOR <RETURN> OR CTRL-C
	IF A%=03H THEN GOTO 6200					REMARK  TERMINATE PROGRAM IF CTRL-C PRESSED
	IF A% <> 0DH THEN GOTO 6000.1					REMARK  WAIT FOR <RETURN> TO BE PRESSED
	Y9=2:OPEN "G/I0F010.DAT" RECL 200 AS Y9
	GOSUB 700							REMARK  READ GENERAL INFORMATION FILE
	LPRINTER							REMARK  SELECT PRINTER AS OUTPUT DEVICE
	OPEN "P/R0F110.DAT" RECL 1150 AS 1				REMARK  OPEN EMPLOYEE MASTER FILE
	X4$="INSURANCE CLASS REPORT"
	LINE.COUNT%=60
	FOR J%=1 TO MSTR.RECORDS					REMARK  USE THE ENTIRE MASTER FILE
	X0=J%
	GOSUB 745							REMARK  READ EMPLOYEE RECORD
	IF S(3)>99 THEN\						REMARK  IF INSURANCE CLASS IS INVALID, ADD MONTHLY
	E(1)=E(1)+S(7):\						        AMOUNTS TO ERROR TOTAL
	E(2)=E(2)+S(10)\
	ELSE\
	I=S(3)+1:\							REMARK  OTHERWISE, ADD TO INSURANCE CLASS TOTAL
	C1(I)=C1(I)+S(7):\
	C2(I)=C2(I)+S(10)
	A(1)=A(1)+S(7)							REMARK  ACCUMULATE TOTAL MONTHLY PAY
	A(2)=A(2)+S(10)							REMARK  ACCUMULATE INSURANCE-EXCLUDABLE TOTAL
	NEXT J%
6055	FOR I%=1 TO 100
	IF C1(I%)=0 THEN 6080
	GOSUB 825
	PRINT USING MASKA$;I%-1,C1(I%),C2(I%),C1(I%)-C2(I%)
	LINE.COUNT%=LINE.COUNT%+1
6080	NEXT I%
	IF E(1)=0 THEN 6095
	PRINT USING MASKB$;"ERROR",E(1),E(2),E(1)-E(2)
6095	PRINT
	PRINT USING MASKB$;"TOTAL",A(1),A(2),A(1)-A(2)
6200	CONSOLE
	PRINT CLEAR.SCREEN$;"P/R INSURANCE REPORT LOADING MENU"		REMARK  EXIT PROGRAM AND LOAD MENU
