Hi All,
Need help adding an update database to existing code.
So as mentioned in other threads with pleads for help... I am a novice programmer, my dad had built all my programs, I am maintaining them.
In this one program, we run a series of data validity checks before executing a larger procedure. One of those validity checks I have pasted that code below. The database used is called CONTRACT and the check is to calculate a date and then see if that date matches what is in the database. If it doesn't, the program writes out the discrepancy to a report. Due to COVID19, a bunch of changes occurred which resulted in several hundred discrepancies. My goal is to convert the below to a standalone program and rather than report the discrepancy, I would like it to update the Contract database with the calculated "PROGRAM" value.
If anyone can provide solution and explain, I am trying to learn. Thank you.
Joe
USE Contract IN 0 && 03/12/2006 ORDER TAG acctno
@ ROW()+1,5 SAY "Last Due Date Report " COLOR W+
STORE 0 TO lnWrong, lnChk, lnSkipB, lnSkipP
? "LAST DUE DATE REPORT" AT 5
?
SELECT Contract
SCAN
IF Contract.bal_due = 0
lnSkipB = lnSkipB+1
LOOP
ENDIF
m.acctno = Contract.acctno && 11/05/2002
SELECT COUNT(*) AS count FROM Ma_Misc;
WHERE Ma_Misc.acctno = m.acctno AND Ma_Misc.status = "POP";
INTO CURSOR test
IF count > 0
lnSkipP = lnSkipP+1
LOOP
ENDIF
lnChk = lnChk+1
nwlast_due = CalcDate(Contract.pymt_ddate,Contract.frequency,Contract.t_num_pymt,Contract.pymt_num) && 12/02/11
IF nwlast_due # Contract.last_due
IF YEAR(Contract.pymt_ddate) = 2099 AND;
(Contract.status = "SUS" OR (RIGHT(Contract.status,1) = "S" AND LEFT(Contract.status,1) = "W")) && Indefinite suspend 01/25/13
LOOP
ENDIF
IF lnWrong = 0
? " CONTRACT PROGRAM" AT 1
? "ACCTNO DATE DATE " AT 1
ENDIF
lnWrong = lnWrong+1
? Contract.acctno+" "+DTOC(Contract.last_due)+" "+DTOC(nwlast_due) AT 1
ENDIF
ENDSCAN
Need help adding an update database to existing code.
So as mentioned in other threads with pleads for help... I am a novice programmer, my dad had built all my programs, I am maintaining them.
In this one program, we run a series of data validity checks before executing a larger procedure. One of those validity checks I have pasted that code below. The database used is called CONTRACT and the check is to calculate a date and then see if that date matches what is in the database. If it doesn't, the program writes out the discrepancy to a report. Due to COVID19, a bunch of changes occurred which resulted in several hundred discrepancies. My goal is to convert the below to a standalone program and rather than report the discrepancy, I would like it to update the Contract database with the calculated "PROGRAM" value.
If anyone can provide solution and explain, I am trying to learn. Thank you.
Joe
USE Contract IN 0 && 03/12/2006 ORDER TAG acctno
@ ROW()+1,5 SAY "Last Due Date Report " COLOR W+
STORE 0 TO lnWrong, lnChk, lnSkipB, lnSkipP
? "LAST DUE DATE REPORT" AT 5
?
SELECT Contract
SCAN
IF Contract.bal_due = 0
lnSkipB = lnSkipB+1
LOOP
ENDIF
m.acctno = Contract.acctno && 11/05/2002
SELECT COUNT(*) AS count FROM Ma_Misc;
WHERE Ma_Misc.acctno = m.acctno AND Ma_Misc.status = "POP";
INTO CURSOR test
IF count > 0
lnSkipP = lnSkipP+1
LOOP
ENDIF
lnChk = lnChk+1
nwlast_due = CalcDate(Contract.pymt_ddate,Contract.frequency,Contract.t_num_pymt,Contract.pymt_num) && 12/02/11
IF nwlast_due # Contract.last_due
IF YEAR(Contract.pymt_ddate) = 2099 AND;
(Contract.status = "SUS" OR (RIGHT(Contract.status,1) = "S" AND LEFT(Contract.status,1) = "W")) && Indefinite suspend 01/25/13
LOOP
ENDIF
IF lnWrong = 0
? " CONTRACT PROGRAM" AT 1
? "ACCTNO DATE DATE " AT 1
ENDIF
lnWrong = lnWrong+1
? Contract.acctno+" "+DTOC(Contract.last_due)+" "+DTOC(nwlast_due) AT 1
ENDIF
ENDSCAN