Professional Documents
Culture Documents
07 January 2005
Agenda
07 January 2005
Prerequisites
07 January 2005
Why NOFILE Enquiry ?
Routine
07 January 2005
Setting up the ENQUIRY Application
Define it in STANDARD.SELECTION
07 January 2005
Setting up the ENQUIRY Application
07 January 2005
Setting up a NOFILE Enquiry
07 January 2005
NOFILE Enquiry Example
Customer Report
Date : <Today’s date> User : <User Id of the user executing the enquiry>
Customer Number : <Customer ID>
Account No Total Fwd Cr Total Fwd Dr Total Cr Int Total Dr Int
XXXXXX XXXXXX XXXXXX XXXXXX XXXXXX
XXXXXX XXXXXX XXXXXX XXXXXX XXXXXX
XXXXXX XXXXXX XXXXXX XXXXXX XXXXXX
A customer, at any point in time, may want to know the total of his
• Forward credit movements (Money that is due to the customer at a future date)
• Forward debit movements (Money that the customer is liable to pay at a future
date)
• Accrued interest that is due to the customer (total)
• Accrued interest that the customer is liable to pay (total)
07 January 2005
Files To Be Used
07 January 2005
Solution 1 - Algorithm
AC1FMAC2FMAC3FMAC4
AcIdFMCoCodeFMLCYAmtFMTranCodeFMCusIDFM……………….
07 January 2005
Solution 1 - Algorithm
CrIntDateFMCrNoOfDaysFMCrIntRateFMCrIntAmtFMCrIntCategFM…..TotalInterest
PrFstDateFMPrLstDtFMDrIntDateFMDrNoOfDaysFM..TotalInterest
07 January 2005
Routine for the NOFILE Enquiry
SUBROUTINE E.NOF.CUS.AC.DET(AC.DET.ARR)
GOSUB INITIALISATION
GOSUB OPEN.FILES
GOSUB PROCESS
RETURN
07 January 2005
Routine for the NOFILE Enquiry
*--------------*
INITIALISATION:
*--------------*
FN.CUSTOMER.ACCOUNT = 'F.CUSTOMER.ACCOUNT'
FV.CUSTOMER.ACCOUNT = ''
FN.ACCT.ENT.FWD = 'F.ACCT.ENT.FWD'
FV.ACCT.ENT.FWD = ''
FN.STMT.ENTRY = 'F.STMT.ENTRY'
FV.STMT.ENTRY = ''
FN.ACCR.ACCT.CR = 'F.ACCR.ACCT.CR'
FV.ACCR.ACCT.CR = ''
FN.ACCR.ACCT.DR = 'F.ACCR.ACCT.DR'
FV.ACCR.ACCT.DR = ''
RETURN
07 January 2005
Routine for the NOFILE Enquiry
*----------*
OPEN.FILES:
*----------*
CALL OPF(FN.CUSTOMER.ACCOUNT,FV.CUSTOMER.ACCOUNT)
CALL OPF(FN.ACCT.ENT.FWD,FV.ACCT.ENT.FWD)
CALL OPF(FN.ACCR.ACCT.CR,FV.ACCR.ACCT.CR)
CALL OPF(FN.STMT.ENTRY,FV.STMT.ENTRY)
CALL OPF(FN.ACCR.ACCT.DR,FV.ACCR.ACCT.DR)
RETURN
*-------*
PROCESS:
*-------*
CALL
F.READ(FN.CUSTOMER.ACCOUNT,CUSTOMER.ID,CUS.ACC.REC,FV.CUSTOMER.ACCOUNT,CUS.ACC
.R.ERR)
07 January 2005
Routine for the NOFILE Enquiry
LOOP
WHILE AC.ID:AC.POS
GOSUB CALC.ENT.FWD
GOSUB CALC.ACCR.INT
AC.DET.ARR<-1> = AC.ID:"*":CR.AMT:"*":DR.AMT:"*":CR.TOT.INT:"*":DR.TOT.INT
REPEAT
RETURN
07 January 2005
Routine for the NOFILE Enquiry
*------------*
CALC.ENT.FWD:
*------------*
LOOP
REMOVE ACCT.ENT.ID FROM ACCT.ENT.REC SETTING ACCT.ENT.POS
WHILE ACCT.ENT.ID:ACCT.ENT.POS
CALL
F.READ(FN.STMT.ENTRY,ACCT.ENT.ID,STMT.ENTRY.REC,FV.STMT.ENTRY,STMT.ENTRY.R.ERR)
ACCT.ENT.AMT = STMT.ENTRY.REC<AC.STE.AMOUNT.LCY>
IF ACCT.ENT.AMT LT 0 THEN
DR.AMT += ABS(ACCT.ENT.AMT)
END ELSE
CR.AMT += ACCT.ENT.AMT
END
07 January 2005
Routine for the NOFILE Enquiry
REPEAT
RETURN
*-------------*
CALC.ACCR.INT:
*-------------*
CR.TOT.INT = AC.CR.REC<IC.ACRCR.TOTAL.INTEREST>
CALL F.READ(FN.ACCR.ACCT.DR,AC.ID,AC.DR.REC,FV.ACCR.ACCT.DR,ACCT.DR.R.ERR)
DR.TOT.INT = AC.DR.REC<IC.ACRDR.TOTAL.INTEREST>
RETURN
END
07 January 2005
STANDARD SELECTION Record
07 January 2005
STANDARD SELECTION Record
Routine Type
Selection Type
07 January 2005
Enquiry Set Up
07 January 2005
ENQUIRY Record
07 January 2005
Executing The Enquiry
Before the Enquiry results are displayed, since we have defined a selection
field, this appears for the user to input the CUSTOMER ID to be manipulated
07 January 2005
Sample Output
07 January 2005
Summary
07 January 2005
Summary (Cont.)
07 January 2005