Hello Everyone,
This is to request everyones' kind assistance to help me on how to insert one column in the programming code shown below to insert [FBAL] from table FEB11CUS.
Everyones' assistance is highly appreciated.
Thanks!
3dob
MAR11CUS:
FCUSTNO FFIRSTNAME FCOMPANY FROUTENO FREADDATE
127510 TRIPLE J BARRACK 10000 000002 2/28/2011
FREADING FMULTIPL FCLASS FBAL FCURPMT FCURAMT
81064 1 WMR 53163.39 0 936.53
***************************************************************
FEB11CUS:
FCUSTNO FFIRSTNAME FCOMPANY FROUTENO FREADDATE
127510 TRIPLE J BARRACK 10000 000002 1/31/2011
FREADING FMULTIPL FCLASS FBAL FCURPMT FCURAMT
78448 1 WMR 52226.86 0 840.78
**************************************************************
PROGRAMMING CODES:
Clear
SET PRINT ON
*? chr(15)
SET PRINT OFF
SET STATUS OFF
SET TALK OFF
SET ESCAPE OFF
SET EXACT ON
SET CONFIRM ON
SET BELL OFF
USE &LCUSFILE INDEX &LCUSRTNDX
store 'ROUTE NUMBER' TO LNDX
LN=61
STORE 0 TO LPG
STORE SPACE(60) TO LHEADING
STORE .F. TO LGOOD
STORE FROUTENO TO LROUTENO
DO WHILE .NOT. LGOOD
Clear
store '00000 000000' to LEND_RT
@ 03,01 say 'Input routeno'
@ 03,24 get lrouteno PICT 'XXXXX XXXXXX'
@ 04,01 SAY 'ENDING ROUTE:'
@ 04,24 GET LEND_RT PICT 'XXXXX XXXXXX'
@ 05,01 SAY 'HEADING'
@ 06,10 GET LHEADING
READ
SEEK LROUTENO
SET ESCAPE ON
IF .NOT. EOF()
STORE .T. TO LGOOD
ENDIF
ENDDO
STORE .T. TO LNEXT
SET DEVICE TO PRINT
STORE 0 TO LBAL_GTOT, L30_GTOT, L60_GTOT, L90_GTOT, L0_29GTOT
DO WHILE LNEXT .AND. .NOT. EOF()
IF LN>60
LPG=LPG+1
EJECT
@ 01, 01 SAY 'PAGE '
@ 01, 06 SAY LPG PICT '99'
@ 01, 20 SAY DATE()
@ 01, 35 SAY LCUSFILE
@ 02, 52 SAY 'CUSTOMERS REPORT BY '+LNDX
@ 04, 20 SAY LHEADING
@ 06, 15 SAY 'ACCOUNT'
@ 06, 25 SAY 'C O N S U M E R S'
@ 06, 54 SAY 'MULTP'
@ 06, 73 SAY 'READING'
@ 06, 84 SAY 'RECENT'
@ 06, 98 SAY 'NEW'
@ 06, 116 SAY '60-DAY'
@ 06, 127 SAY '90-DAY'
@ 07, 0 SAY 'ROUTE NUMBER'
@ 07, 15 SAY 'NUMBER'
@ 07, 23 SAY 'FIRST'
@ 07, 32 SAY 'LAST/FCOMPANY'
@ 07, 49 SAY 'CLAS'
@ 07, 54 SAY '-LIER'
@ 07, 63 SAY 'READING'
@ 07, 76 SAY 'DATE'
@ 07, 84 SAY 'PMT/ADJ'
@ 07, 94 SAY 'CHARGES'
@ 07,104 SAY 'BALANCE'
@ 07,114 SAY 'PAST DUE'
@ 07,125 SAY 'PAST DUE'
LN=9
ENDIF
STORE 0 TO LTOT_PMT, L60_DAYS, L30_DAYS, L90_DAYS, L0_29DAYS, LAGE_SUM
IF FBAL <= 0
LTOT_PMT = 0
L90_DAYS = 0
L60_DAYS = 0
L30_DAYS = 0
L0_29DAYS= FBAL
ELSE
IF FCURPMT >0
LTOT_PMT = FCURPMT
ENDIF
IF F30PMT >0
LTOT_PMT = LTOT_PMT + F30PMT
ENDIF
IF F60PMT > 0
LTOT_PMT = LTOT_PMT + F60PMT
ENDIF
IF FCURAMT < 0
LTOT_PMT = LTOT_PMT - FCURAMT
ENDIF
IF F30AMT < 0
LTOT_PMT = LTOT_PMT - F30AMT
ENDIF
IF F60AMT < 0
LTOT_PMT = LTOT_PMT - F60AMT
ENDIF
IF LTOT_PMT >= F90BAL
LTOT_PMT = LTOT_PMT - F90BAL
L90_DAYS = 0
ELSE
L90_DAYS = F90BAL - LTOT_PMT
LTOT_PMT = 0
ENDIF
IF F60AMT > 0
L60_DAYS = F60AMT
ENDIF
IF F60PMT < 0
L60_DAYS = L60_DAYS - F60PMT
ENDIF
IF LTOT_PMT >= L60_DAYS
LTOT_PMT = LTOT_PMT - L60_DAYS
L60_DAYS = 0
ELSE
L60_DAYS = L60_DAYS - LTOT_PMT
LTOT_PMT = 0
ENDIF
IF F30AMT > 0
L30_DAYS = F30AMT
ENDIF
IF F30PMT < 0
L30_DAYS = L30_DAYS - F30PMT
ENDIF
IF LTOT_PMT >= L30_DAYS
LTOT_PMT = LTOT_PMT - L30_DAYS
L30_DAYS = 0
ELSE
L30_DAYS = L30_DAYS - LTOT_PMT
LTOT_PMT = 0
ENDIF
IF FCURAMT > 0
L0_29DAYS = FCURAMT
ENDIF
* CHANGE TO FCURPMT
IF FCURPMT < 0
L0_29DAYS = L0_29DAYS - FCURPMT
ENDIF
IF LTOT_PMT >= L0_29DAYS
L0_29DAYS = 0
ELSE
L0_29DAYS = L0_29DAYS - LTOT_PMT
ENDIF
ENDIF
* SUMMATION OF PAST DUES
* LAGE_SUM = LAGE_SUM+L0_29DAYS+L30_DAYS+L60_DAYS+L90_DAYS
@ LN, 00 SAY FROUTENO
@ LN, 15 SAY FCUSTNO
@ LN, 22 SAY LEFT(FFIRSTNAME,9)
@ LN, 32 SAY LEFT(FCOMPANY,16)
@ LN, 49 SAY FCLASS
@ LN, 54 SAY FMULTIPL
@ LN, 63 SAY FREADING PICT '9999999'
@ LN, 72 SAY FREADDATE PICT '@D'
@ LN, 82 SAY FCURPMT PICT '999999.99'
@ LN, 92 SAY FCURAMT PICT '999999.99'
@ LN,102 SAY FBAL PICT '999999.99'
@ LN, 113 SAY L60_DAYS PICT '999999.99'
@ LN, 124 SAY L90_DAYS PICT '999999.99'
* @ LN, 135 SAY L60_DAYS PICT '999999.99'
* @ LN, 146 SAY L90_DAYS PICT '999999.99'
* @ LN, 157 SAY LAGE_SUM PICT '999999.99'
LBAL_GTOT = LBAL_GTOT + FBAL
L0_29GTOT = L0_29GTOT+ L0_29DAYS
L30_GTOT = L30_GTOT + L30_DAYS
L60_GTOT = L60_GTOT + L60_DAYS
L90_GTOT = L90_GTOT + L90_DAYS
SKIP
LN=LN+1
IF FROUTENO > LEND_RT
STORE .F. TO LNEXT
ENDIF
ENDDO
LN=LN+2
@ LN, 49 SAY "BALANCE = "
@ LN, 63 SAY " 0-29-DAY + "
@ LN, 85 SAY "30-DAY + "
@ LN, 105 SAY "60-DAY + "
@ LN, 127 SAY "90-DAY "
LN=LN+1
@ LN, 44 SAY LBAL_GTOT PICT '9,999,999.99'
@ LN, 62 SAY L0_29GTOT PICT '9,999,999.99'
@ LN, 79 SAY L30_GTOT PICT '9,999,999.99'
@ LN, 99 SAY L60_GTOT PICT '9,999,999.99'
@ LN, 121 SAY L90_GTOT PICT '9,999,999.99'
*@ LN, 99 SAY LBAL_GTOT PICT '9,999,999.99'
*@ LN, 121 SAY L90_GTOT PICT '9,999,999.99'
*@ LN+1, 112 SAY L60_GTOT PICT '999,999.99'
EJECT
SET DEVICE TO SCREEN
SET PROC TO
CLOSE DATABASES
RETURN
This is to request everyones' kind assistance to help me on how to insert one column in the programming code shown below to insert [FBAL] from table FEB11CUS.
Everyones' assistance is highly appreciated.
Thanks!
3dob
MAR11CUS:
FCUSTNO FFIRSTNAME FCOMPANY FROUTENO FREADDATE
127510 TRIPLE J BARRACK 10000 000002 2/28/2011
FREADING FMULTIPL FCLASS FBAL FCURPMT FCURAMT
81064 1 WMR 53163.39 0 936.53
***************************************************************
FEB11CUS:
FCUSTNO FFIRSTNAME FCOMPANY FROUTENO FREADDATE
127510 TRIPLE J BARRACK 10000 000002 1/31/2011
FREADING FMULTIPL FCLASS FBAL FCURPMT FCURAMT
78448 1 WMR 52226.86 0 840.78
**************************************************************
PROGRAMMING CODES:
Clear
SET PRINT ON
*? chr(15)
SET PRINT OFF
SET STATUS OFF
SET TALK OFF
SET ESCAPE OFF
SET EXACT ON
SET CONFIRM ON
SET BELL OFF
USE &LCUSFILE INDEX &LCUSRTNDX
store 'ROUTE NUMBER' TO LNDX
LN=61
STORE 0 TO LPG
STORE SPACE(60) TO LHEADING
STORE .F. TO LGOOD
STORE FROUTENO TO LROUTENO
DO WHILE .NOT. LGOOD
Clear
store '00000 000000' to LEND_RT
@ 03,01 say 'Input routeno'
@ 03,24 get lrouteno PICT 'XXXXX XXXXXX'
@ 04,01 SAY 'ENDING ROUTE:'
@ 04,24 GET LEND_RT PICT 'XXXXX XXXXXX'
@ 05,01 SAY 'HEADING'
@ 06,10 GET LHEADING
READ
SEEK LROUTENO
SET ESCAPE ON
IF .NOT. EOF()
STORE .T. TO LGOOD
ENDIF
ENDDO
STORE .T. TO LNEXT
SET DEVICE TO PRINT
STORE 0 TO LBAL_GTOT, L30_GTOT, L60_GTOT, L90_GTOT, L0_29GTOT
DO WHILE LNEXT .AND. .NOT. EOF()
IF LN>60
LPG=LPG+1
EJECT
@ 01, 01 SAY 'PAGE '
@ 01, 06 SAY LPG PICT '99'
@ 01, 20 SAY DATE()
@ 01, 35 SAY LCUSFILE
@ 02, 52 SAY 'CUSTOMERS REPORT BY '+LNDX
@ 04, 20 SAY LHEADING
@ 06, 15 SAY 'ACCOUNT'
@ 06, 25 SAY 'C O N S U M E R S'
@ 06, 54 SAY 'MULTP'
@ 06, 73 SAY 'READING'
@ 06, 84 SAY 'RECENT'
@ 06, 98 SAY 'NEW'
@ 06, 116 SAY '60-DAY'
@ 06, 127 SAY '90-DAY'
@ 07, 0 SAY 'ROUTE NUMBER'
@ 07, 15 SAY 'NUMBER'
@ 07, 23 SAY 'FIRST'
@ 07, 32 SAY 'LAST/FCOMPANY'
@ 07, 49 SAY 'CLAS'
@ 07, 54 SAY '-LIER'
@ 07, 63 SAY 'READING'
@ 07, 76 SAY 'DATE'
@ 07, 84 SAY 'PMT/ADJ'
@ 07, 94 SAY 'CHARGES'
@ 07,104 SAY 'BALANCE'
@ 07,114 SAY 'PAST DUE'
@ 07,125 SAY 'PAST DUE'
LN=9
ENDIF
STORE 0 TO LTOT_PMT, L60_DAYS, L30_DAYS, L90_DAYS, L0_29DAYS, LAGE_SUM
IF FBAL <= 0
LTOT_PMT = 0
L90_DAYS = 0
L60_DAYS = 0
L30_DAYS = 0
L0_29DAYS= FBAL
ELSE
IF FCURPMT >0
LTOT_PMT = FCURPMT
ENDIF
IF F30PMT >0
LTOT_PMT = LTOT_PMT + F30PMT
ENDIF
IF F60PMT > 0
LTOT_PMT = LTOT_PMT + F60PMT
ENDIF
IF FCURAMT < 0
LTOT_PMT = LTOT_PMT - FCURAMT
ENDIF
IF F30AMT < 0
LTOT_PMT = LTOT_PMT - F30AMT
ENDIF
IF F60AMT < 0
LTOT_PMT = LTOT_PMT - F60AMT
ENDIF
IF LTOT_PMT >= F90BAL
LTOT_PMT = LTOT_PMT - F90BAL
L90_DAYS = 0
ELSE
L90_DAYS = F90BAL - LTOT_PMT
LTOT_PMT = 0
ENDIF
IF F60AMT > 0
L60_DAYS = F60AMT
ENDIF
IF F60PMT < 0
L60_DAYS = L60_DAYS - F60PMT
ENDIF
IF LTOT_PMT >= L60_DAYS
LTOT_PMT = LTOT_PMT - L60_DAYS
L60_DAYS = 0
ELSE
L60_DAYS = L60_DAYS - LTOT_PMT
LTOT_PMT = 0
ENDIF
IF F30AMT > 0
L30_DAYS = F30AMT
ENDIF
IF F30PMT < 0
L30_DAYS = L30_DAYS - F30PMT
ENDIF
IF LTOT_PMT >= L30_DAYS
LTOT_PMT = LTOT_PMT - L30_DAYS
L30_DAYS = 0
ELSE
L30_DAYS = L30_DAYS - LTOT_PMT
LTOT_PMT = 0
ENDIF
IF FCURAMT > 0
L0_29DAYS = FCURAMT
ENDIF
* CHANGE TO FCURPMT
IF FCURPMT < 0
L0_29DAYS = L0_29DAYS - FCURPMT
ENDIF
IF LTOT_PMT >= L0_29DAYS
L0_29DAYS = 0
ELSE
L0_29DAYS = L0_29DAYS - LTOT_PMT
ENDIF
ENDIF
* SUMMATION OF PAST DUES
* LAGE_SUM = LAGE_SUM+L0_29DAYS+L30_DAYS+L60_DAYS+L90_DAYS
@ LN, 00 SAY FROUTENO
@ LN, 15 SAY FCUSTNO
@ LN, 22 SAY LEFT(FFIRSTNAME,9)
@ LN, 32 SAY LEFT(FCOMPANY,16)
@ LN, 49 SAY FCLASS
@ LN, 54 SAY FMULTIPL
@ LN, 63 SAY FREADING PICT '9999999'
@ LN, 72 SAY FREADDATE PICT '@D'
@ LN, 82 SAY FCURPMT PICT '999999.99'
@ LN, 92 SAY FCURAMT PICT '999999.99'
@ LN,102 SAY FBAL PICT '999999.99'
@ LN, 113 SAY L60_DAYS PICT '999999.99'
@ LN, 124 SAY L90_DAYS PICT '999999.99'
* @ LN, 135 SAY L60_DAYS PICT '999999.99'
* @ LN, 146 SAY L90_DAYS PICT '999999.99'
* @ LN, 157 SAY LAGE_SUM PICT '999999.99'
LBAL_GTOT = LBAL_GTOT + FBAL
L0_29GTOT = L0_29GTOT+ L0_29DAYS
L30_GTOT = L30_GTOT + L30_DAYS
L60_GTOT = L60_GTOT + L60_DAYS
L90_GTOT = L90_GTOT + L90_DAYS
SKIP
LN=LN+1
IF FROUTENO > LEND_RT
STORE .F. TO LNEXT
ENDIF
ENDDO
LN=LN+2
@ LN, 49 SAY "BALANCE = "
@ LN, 63 SAY " 0-29-DAY + "
@ LN, 85 SAY "30-DAY + "
@ LN, 105 SAY "60-DAY + "
@ LN, 127 SAY "90-DAY "
LN=LN+1
@ LN, 44 SAY LBAL_GTOT PICT '9,999,999.99'
@ LN, 62 SAY L0_29GTOT PICT '9,999,999.99'
@ LN, 79 SAY L30_GTOT PICT '9,999,999.99'
@ LN, 99 SAY L60_GTOT PICT '9,999,999.99'
@ LN, 121 SAY L90_GTOT PICT '9,999,999.99'
*@ LN, 99 SAY LBAL_GTOT PICT '9,999,999.99'
*@ LN, 121 SAY L90_GTOT PICT '9,999,999.99'
*@ LN+1, 112 SAY L60_GTOT PICT '999,999.99'
EJECT
SET DEVICE TO SCREEN
SET PROC TO
CLOSE DATABASES
RETURN