perm filename CMS2.SHT[T,LSP] blob sn#620935 filedate 1981-10-21 generic text, type T, neo UTF8
GETDUES: 
	PROCEDURE OPTIONS (MAIN);

	/*PROGRAM TO PROCESS OVERDUE BOOKS AND CHARGE APPROPRIATE FINE*/

	DECLARE
		NAME CHAR (15), /*NAME OF PATRON*/
		ACC_# CHAR (10), /*ACCESSION NO. OF BK*/
		DATE FIXED DECIMAL (3,0), /*DAY BK. BORROWED*/
		LOAN_PER FIXED DECIMAL (3,0), /*LOAN PERIOD*/
		TODAY FIXED DECIMAL (3,0), /*TODAY'S DATE/
		BRIBE_RATE FIXED DECIMAL (5,2), /*PER DIEM FINE*/
		BRIBE FIXED DECIMAL (5,2), /*TO TAKE HOLD OFF REGISTRATION*/
		FLAG FIXED DECIMAL (1,0), /*QUIT FLAG*/
		TOTAL FIXED DECIMAL (5,2); /*TOTAL AMT. OF FINES*/
		
	/*INITIALIZE VARIABLES*/

	TODAY = 235;
	TOTAL = 0;
	FLAG = 0;
	BRIBE_RATE = .05;
	ON ENDFILE (SYSIN) FLAG = 1;

	PUT SKIP LIST (`BORROWER NAME',`AMOUNT DUE');

SHITLST: 	DO WHILE (FLAG = 0);  /*PERUSE VICTIMS*/
		GET LIST (NAME,ACC_#,DATE,LOAN_PER);
		IF TODAY > DATE + LOAN_PER THEN /*COMPUTE BRIBE FOR OVERDUE BKS*/
		 DOBRIBE: DO;
		   	BRIBE = (TODAY - (DATE + LOAN_PER))*BRIBE_RATE; 
			TOTAL = TOTAL + BRIBE;
			PUT SKIP LIST (NAME,BRIBE); /*OFFENDERS ON THE SHIT LIST*/
			END DOBRIBE;
		END SHITLST;

	/*PRINT RESULTS*/

	PUT SKIP LIST (`TOTAL DUE',TOTAL);

	END GETDUES;