*-------------------------------------------------------------------------* * MSD.FUND.STATUS.REPORT * AUTHOR : AL SURLES * DATE : 07-20-93 * PURPOSE : TO PRINT A REPORT OF PARTNERS WHICH MEET THE STATUS CODE(S), * FUND CODE, TRANS IN LAST # OF DAYS, WITHIN A DATE RANGE. * W/O # : 130-30712(HDEC) - 07/22/93 AND 130-30727(HDEC) - 08/04/93 * UPDATES: *-------------------------------------------------------------------------* $INCLUDE GEN.COM2 $INCLUDE PM $INCLUDE PM.TRANS OPEN "PM" TO PM ELSE ABORT "PM" OPEN "PM.TRANS" TO PMT ELSE ABORT "PM.TRANS" OPEN "TITLE" TO TITLE.FILE ELSE ABORT "TITLE" OPEN "FUND.STATUS.WORKFILE" TO WORK ELSE ABORT "FUND.STATUS.WORKFILE" OPEN "FUND.FILE" TO FUND.FILE ELSE ABORT "FUND.FILE" *-------------------------------------------------------------------------* CRT CS CRT @(0,0):"MSD.FUND.STATUS.REPORT" CRT @(0,1):RV:SPACE(80):ERV HD='FUND STATUS REPORT' HDL=(80-LEN(HD))/2 CRT @(HDL,1):RV:HD:ERV *-------------------------------------------------------------------------* CRT @(0,4):CR EXECUTE "EX PRINTER" 10 * Prompt for fund code to used CRT @(0,2):CR:"Please input the FUND CODE to be used (EX: 3000) :": INPUT FUND.CODE IF FUND.CODE="" OR FUND.CODE=PF3 THEN GO 99 READ FUND.REC FROM FUND.FILE,FUND.CODE ELSE CRT @(0,22):"FUND CODE ":RV:" ":FUND.CODE:" ":ERV:" NOT ON FILE" RQM ; RQM ; GO 10 END *----------* 20 * Promt for status code(s) to include CRT @(0,4):CR:"Please input status code(s) to INCLUDE seperated by" CRT @(0,5):"a comma (EX: M,A,COM) :": INPUT STATUS.CODES IF STATUS.CODES="" OR STATUS.CODES=PF3 THEN GO 99 IF STATUS.CODES=PF1 THEN GO 10 *--------* 30 * Promt for status code(s) to exclude CRT @(0,7):CR:"Please input the status code(s) to be EXCLUDED seperated by" CRT @(0,8):"a comma (EXAMPLE: 84,91,95,NL) :": INPUT EXCL.STATUS IF EXCL.STATUS=PF3 THEN GO 99 IF EXCL.STATUS=PF1 THEN GO 20 *----------* 40 * PROMPT FOR TRANS IN LAST # OF DAYS CRT @(0,10):CR:"Please input # of days to check SINCE partner had a TRANS (EX: 14) -" CRT @(0,11):"means it will check for a trans in the last 14 days :": INPUT LAST.DAYS IF LAST.DAYS="" OR LAST.DAYS=PF3 THEN GO 99 IF LAST.DAYS=PF1 THEN GO 30 TEST.DAYS=NUM(LAST.DAYS) IF NOT(TEST.DAYS) THEN GO 40 *-------* 50 * Prompt for sort criteria for output. CRT @(0,13):CR:"Do you want report sorted by LAST NAME or by DESCENDING AMOUNT (LN/DA) :": INPUT RPT.SORT IF RPT.SORT="" OR RPT.SORT=PF3 THEN GO 99 IF RPT.SORT=PF1 THEN GO 40 IF RPT.SORT="LN" OR RPT.SORT="DA" ELSE GO 50 *--------* 55 * Give user option of excluding names with 0.00 totals CRT @(0,15):CR:"Do you want to EXCLUDE people whose $ total is zero? (Y/N) :": INPUT ZERO.ANS IF ZERO.ANS="" OR ZERO.ANS=PF3 THEN GO 99 IF ZERO.ANS=PF1 THEN GO 50 IF ZERO.ANS[1,1]="Y" OR ZERO.ANS[1,1]="N" ELSE GO 55 *--------* 60 * Check to see if user want total amount within a date range. CRT @(0,17):CR:"Do you want to PRINT the TOTAL AMOUNT of giving (Y/N) :": INPUT RANGE.ANS IF RANGE.ANS="" OR RANGE.ANS=PF3 THEN GO 99 IF RANGE.ANS=PF1 THEN GO 55 IF RANGE.ANS[1,1] = "Y" OR RANGE.ANS[1,1] = "N" ELSE GO 60 IF RANGE.ANS[1,1]="Y" THEN 65 * Begin date prompt CRT @(4,19):CR:"Please input BEGINNING date range (EX: 01/01/93) :": INPUT BDATE IF BDATE="" OR BDATE=PF3 THEN GO 99 IF BDATE=PF1 THEN GO 60 BEGIN.DATE=ICONV(BDATE,"D") IF BEGIN.DATE="" OR BEGIN.DATE=0 THEN CRT @(0,22):"INVALID DATE FORMAT":CL RQM ; GO 65 END *------* 70 * Ending date prompt CRT @(4,20):CR:"Please input ENDING date range (EX: 12/31/93) :": INPUT EDATE IF EDATE="" OR EDATE=PF3 THEN GO 99 IF EDATE=PF1 THEN GO 65 END.DATE=ICONV(EDATE,"D") IF END.DATE="" OR END.DATE=0 THEN CRT @(0,22):"INVALID DATE FORMAT":CL RQM ; GO 70 END END *------* 80 * CRT @(0,22):CR:"Is everything correct (Y/N) ? :": INPUT ANS IF ANS = "N" THEN GO 10 IF ANS="Y" OR ANS="N" ELSE GO 80 85 * CRT @(0,2):CR:"THE SELECT CRITERIA IS :" *-----* CRT @(0,4):CR:"The FUND CODE criteria is ":RV:" ":FUND.CODE:" ":ERV *-----* ST.LEN=LEN(STATUS.CODES) ST.CD=STATUS.CODES FOR B=1 TO ST.LEN IF ST.CD[B,1]="," THEN ST.CD=ST.CD[1,B-1]:VM:ST.CD[B+1,ST.LEN] NEXT B STATUS="" ST.CNT=DCOUNT(ST.CD,VM) FOR B=1 TO ST.CNT STATUS=STATUS:'"':ST.CD<1,B>:'"' NEXT B STATUS=TRIM(STATUS) CRT @(0,6):"The status code(s) to INCLUDE are ":RV:" ":STATUS:" ":ERV *-----* IF EXCL.STATUS="" THEN STATUS.EXCL="" CRT @(0,8):"The status(s) to EXCLUDE are ":RV:" NONE ":ERV END ELSE ST.LEN=LEN(EXCL.STATUS) ST.EX=EXCL.STATUS FOR B=1 TO ST.LEN IF ST.EX[B,1]="," THEN ST.EX=ST.EX[1,B-1]:VM:ST.EX[B+1,ST.LEN] NEXT B STATUS.EXCL="" ST.CNT=DCOUNT(ST.EX,VM) FOR B=1 TO ST.CNT STATUS.EXCL=STATUS.EXCL:'"':ST.EX<1,B>:'"' NEXT B STATUS.EXCL=TRIM(STATUS.EXCL) CRT @(0,8):"The status code(s) to EXCLUDE are ":RV:" ":STATUS.EXCL:" ":ERV END *-----* CRT @(0,10):"The last # of days SINCE a transaction is ":RV:" ":LAST.DAYS:" ":ERV *-----* IF RPT.SORT="LN" THEN CRT @(0,12):"The SORT SEQUENCE is by ":RV:" LAST NAME ":ERV END ELSE CRT @(0,12):"The SORT SEQUENCE IS BY ":RV:" DESCENDING AMOUNT ":ERV END *-----* CRT @(0,14):"To Exclude Names with Zero Totals is ":RV:" ":ZERO.ANS:" ":ERV *-----* CRT @(0,16):"To PRINT total amount is ":RV:" ":RANGE.ANS:" ":ERV *-----* IF RANGE.ANS[1,1] = "Y" THEN CRT @(0,18):"The BEGINING date range is ":RV:" ":OCONV(BEGIN.DATE,"D2/"):" ":ERV *-----* CRT @(0,20):"The ENDING date range is ":RV:" ":OCONV(END.DATE,"D2/"):" ":ERV END *-----* CRT @(0,22):CR:"Are you sure EVERYTHING is correct (Y/N) :": INPUT ANSWER IF ANSWER[1,1] = "" OR ANSWER[1,1] = PF3 THEN GO 99 IF ANSWER = PF1 THEN GO 65 IF ANSWER[1,1] = "N" THEN GO 10 IF ANSWER[1,1] = "Y" OR ANSWER[1,1] = "N" ELSE GO 65 *-------------------------------------------------------------------------* CLEARFILE WORK 90 * SELECT PARTNERS WITH CRITERIA IF STATUS.EXCL="" THEN CMND='SELECT PM WITH STATUS ':STATUS:' ' END ELSE CMND='SELECT PM WITH STATUS ':STATUS:' AND WITHOUT STATUS ':STATUS.EXCL:' ' END EXECUTE CMND CUTOFF.DATE=DATE()-LAST.DAYS SPOUSE.FLAG=0 IF ZERO.ANS[1,1]='Y' THEN ZERO.FLAG=1 ELSE ZERO.FLAG=0 95 * EOF=0 ; REC.READ=0 ; REC.QUAL=0 LOOP READNEXT ID ELSE EOF=1 UNTIL EOF DO REC.READ=REC.READ+1 ; QUAL=0 ; PMT.REC="" IF SPOUSE.FLAG THEN ID.PREFIX=OCONV(ID,"G0.1") ; ID.SUFFIX=OCONV(ID,"G1.1") IF ID.SUFFIX="1" THEN ID=ID.PREFIX:".2" END ELSE IF ID.SUFFIX="2" THEN ID=ID.PREFIX:".1" END ELSE GO 97 END END READ WORK.REC FROM WORK,ID THEN GO 97 END READ PMT.REC FROM PMT,ID THEN TR.CNT=DCOUNT(PMT.REC