No File Enquiries
Short Description
No File Enquiries...
Description
Creating NOFILE Enquiries
Agenda • Unde Unders rsta tand ndin ing g why why a NOF NOFIL ILE E enq enqui uiry ry is to be created • St Ste eps to cre rea ate a NO NOF FIL ILE E enqu quir iry y • NOFILE Enquiry – An example • Analysis of the example • Algorithm for the routine • Writing the routine • Se Sett ttin ing g up up the the ST STAN ANDA DARD RD SE SELE LECT CTIO ION N rec recor ord d • Se Settti tin ng up up th the ENQ ENQUI UIR RY app applilica cati tio on • Executing the en enquiry
Prerequisites • Knowledge on the working of the ENQUIRY application • Info BASIC programming skills
Why NOFILE Enquiry ? • When information is required for more than one T24 application (which cannot be linked in the ENQUIRY application) • When complex calculations and conditions are required and involves more than one T24 application No connection between Files – cannot be linked in ENQUIRY Complex calculations that are not supported by the ENQUIRY application
File 1
File 2
File 3
Routine
File 4
Setting up the ENQUIRY Application ENQUIRY : FILE.NAME Field - Mandatory This case - Requires more than one Application Use logical file name Define it in STANDARD.SELECTION No FILE.CONTROL – Validation Error in SS Start STANDARD.SELECTION ID with NOFILE (Will not check for FILE.CONTROL record)
Now use in Enquiry FILE.NAME
Setting up the ENQUIRY Application STANDARD.SELECTION record requires a field Create a logical field How does the field get data? Write a routine and attach it to the logical field User need selection fields ? Define “S”election type fields
Setting up a NOFILE Enquiry Components of a NOFILE Enquiry are • Info BASIC routine • STANDARD.SELECTION record • ENQUIRY record
NOFILE Enquiry Example A bank requires a report in the following format. Customer Report Date :
User :
Customer Number : 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)
Files To Be Used
•
CUSTOMER.ACCOUNT – To obtain the list of accounts for a particular customer
•
ACCT.ENT.FWD – To obtain the forward STMT.ENTRY Ids for an account of a customer
•
STMT.ENTRY – To obtain the details of the STMT.ENTRY record
•
ACCR.ACCT.CR – To obtain accrued credit interest
•
ACCR.ACCT.DR - To obtain accrued credit interest
Solution 1 - Algorithm For the customer number supplied, extract record from CUSTOMER.ACCOUNT AC1FMAC2FMAC3FMAC4 Read ACCT.ENT.FWD with the Account ID Extract the next ID and process
FST1FMFST2FMFST3 Read STMT.ENTRY with the STMT.ENTRY ID
AcIdFMCoCodeFMLCYAmtFMTranCodeFMCusIDFM………………. Extract the local currency amount and check if > than 0 If > 0 then Future Cr Mov += Future Cr Mov else Future Dr Mov += Future Dr Mov
All F STMT entries have been processed
Solution 1 - Algorithm Read the ACCR.ACCT.CR file with the Account ID CrIntDateFMCrNoOfDaysFMCrIntRateFMCrIntAmtFMCrIntCategFM…..TotalInterest Total Credit Interest += Total Interest
Read the ACCR.ACCT.DR file with the Account ID PrFstDateFMPrLstDtFMDr IntDateFMDrNoOfDays FM..TotalInterest
Total Debit Interest += Total Interest
Concatenate values in return parameter: Account ID,Tot Fwd Dr,Tot Fwd Cr,Total Dr Int,Tot Cr Int
Get back to next account
Routine for the NOFILE Enquiry SUBROUTINE E.NOF.CUS.AC.DET(AC.DET.ARR)
$INCLUDE GLOBUS.BP I_COMMON $INCLUDE GLOBUS.BP I_EQUATE $INCLUDE GLOBUS.BP I_F.ACCOUNT $INCLUDE GLOBUS.BP I_F.CUSTOMER $INCLUDE GLOBUS.BP I_F.CUSTOMER.ACCOUNT $INCLUDE GLOBUS.BP I_F.STMT.ENTRY $INCLUDE GLOBUS.BP I_F.ACCR.ACCT.CR $INCLUDE GLOBUS.BP I_F.ACCR.ACCT.DR $INCLUDE GLOBUS.BP I_ENQUIRY.COMMON
GOSUB INITIALISATION GOSUB OPEN.FILES GOSUB PROCESS
RETURN
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
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: *-------* LOCATE "CUSTOMER.ID" IN D.FIELDS SETTING CUS.POS THEN CUSTOMER.ID = D.RANGE.AND.VALUE END
CALL F.READ(FN.CUSTOMER.ACCOUNT,CUSTOMER.ID,CUS.ACC.REC,FV.CUSTOMER.ACCOUNT,CUS.ACC .R.ERR)
Routine for the NOFILE Enquiry
LOOP
REMOVE AC.ID FROM CUS.ACC.REC SETTING AC.POS
WHILE AC.ID:AC.POS
GOSUB CALC.ENT.FWD
GOSUB CALC.ACCR.INT
AC.DET.ARR = AC.ID:"*":CR.AMT:"*":DR.AMT:"*":CR.TOT.INT:"*":DR.TOT.INT
REPEAT
RETURN
Routine for the NOFILE Enquiry *------------* CALC.ENT.FWD: *------------* DR.AMT = '' ; CR.AMT = '' CALL F.READ(FN.ACCT.ENT.FWD,AC.ID,ACCT.ENT.REC,FV.ACCT.ENT.FWD,ACCT.ENT.R.ERR) 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
IF ACCT.ENT.AMT LT 0 THEN DR.AMT += ABS(ACCT.ENT.AMT) END ELSE CR.AMT += ACCT.ENT.AMT END
Routine for the NOFILE Enquiry REPEAT RETURN *-------------* CALC.ACCR.INT: *-------------* CR.TOT.INT = '' ; DR.TOT.INT = '' CALL F.READ(FN.ACCR.ACCT.CR,AC.ID,AC.CR.REC,FV.ACCR.ACCT.CR,ACCT.CR.R.ERR) CR.TOT.INT = AC.CR.REC
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
RETURN END
STANDARD SELECTION Record • ID must start with NOFILE.xxxxx to eliminate FILE.CONTROL validation error • Must have ROUTINE type user field defined • SELECTION type fields can be defined so that the user can decide exactly what information he wants filtered out and displayed
STANDARD SELECTION Record
Routine Type
Selection Type
Enquiry Set Up
Must be a valid record from STANDARD.SELECTION Application. In this case, must start with NOFILE.
ENQUIRY Record
Using this we can access each line of information stored in the return variable. The values are separated by “*” and each set is separated by an FM
This is the method used to extract the values returned from the routine The format is F ,,
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
Sample Output
Summary • A NOFILE enquiry uses a routine to access more than one application to display information required by the user. • A STANDARD.SELECTION record must be created, with an ID NOFILE.xxxxxxx for NOFILE enquiry to eliminate the FILE.CONTROL validation error in T24 • A STANDARD.SELECTION record created for NOFILE enquiry purposes can have logical fields defined in it. – Routine type fields – These fields will have user type ‘R’ – Selection type fields – These fields will have user type‘S’
Summary (Cont.) • Selection fields defined, can be used within the routine using the COMMON variables D.FIELDS and D.RANGE.AND.VALUES defined in I_ENQUIRY.COMMON • A routine written for NOFILE enquiry purposes should return one parameter • The ENQUIRY application uses the ID of the STANDARD. SELECTION in the FILE.NAME field • F ,, - is used to extract the data in the ENQUIRY
View more...
Comments