Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 28

Click to edit Master text styles

Creating NOFILE Enquiries


Second level
Third level
Agenda

 Understanding why a NOFILE enquiry is to be created


 Steps to create a NOFILE enquiry
 NOFILE Enquiry – An example
 Analysis of the example
 Algorithm for the routine
 Writing the routine
 Setting up the STANDARD SELECTION record
 Setting up the ENQUIRY application
 Executing the enquiry

2
Prerequisites

 Knowledge on the working of the ENQUIRY application

 Info BASIC programming skills

3
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

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

5
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

6
Setting up a NOFILE Enquiry

Components of a NOFILE Enquiry are

 Info BASIC routine

 STANDARD.SELECTION record

 ENQUIRY record

7
NOFILE Enquiry Example

A bank requires a report in the following format.


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

8
NOFILE Enquiry Example

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)

9
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

10
Solution 1 - Algorithm

11
Solution 1 - Algorithm

12
Routine for the NOFILE Enquiry

SUBROUTINE TRG.CUS.REPORT(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

13
Routine for the NOFILE Enquiry

*--------------*
INITIALISATION:
*--------------*
FN.CUSTOMER.ACCOUNT = 'F.CUSTOMER.ACCOUNT'
F.CUSTOMER.ACCOUNT = '‘

FN.ACCT.ENT.FWD = 'F.ACCT.ENT.FWD'
F.ACCT.ENT.FWD = '‘

FN.STMT.ENTRY = 'F.STMT.ENTRY'
F.STMT.ENTRY = '‘

FN.ACCR.ACCT.CR = 'F.ACCR.ACCT.CR'
F.ACCR.ACCT.CR = '‘

FN.ACCR.ACCT.DR = 'F.ACCR.ACCT.DR'
F.ACCR.ACCT.DR = '‘

RETURN

14
Routine for the NOFILE Enquiry

*----------*
OPEN.FILES:
*----------*
CALL OPF(FN.CUSTOMER.ACCOUNT,F.CUSTOMER.ACCOUNT)
CALL OPF(FN.ACCT.ENT.FWD,F.ACCT.ENT.FWD)
CALL OPF(FN.ACCR.ACCT.CR,F.ACCR.ACCT.CR)
CALL OPF(FN.STMT.ENTRY,F.STMT.ENTRY)
CALL OPF(FN.ACCR.ACCT.DR,F.ACCR.ACCT.DR)

RETURN

15
Routine for the NOFILE Enquiry

*-------*
PROCESS:
*-------*
LOCATE "CUSTOMER.NO" IN D.FIELDS<1> SETTING CUS.POS THEN
CUSTOMER.NO = D.RANGE.AND.VALUE<CUS.POS>
END
CALL
F.READ(FN.CUSTOMER.ACCOUNT,CUSTOMER.NO,CUS.ACC.REC,F.CUS
TOMER.ACCOUNT,CUS.ACC.R.ERR)
* D.LOGICAL.OPERANDS<CUS.POS> is used to get the operand

16
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<-1> =
AC.ID:"*":CR.AMT:"*":DR.AMT:"*":CR.TOT.INT:"*":DR.TOT.INT
REPEAT
RETURN

17
Routine for the NOFILE Enquiry

*------------*
CALC.ENT.FWD:
*------------*
DR.AMT = '' ; CR.AMT = ''
CALL F.READ(FN.ACCT.ENT.FWD,AC.ID,ACCT.ENT.REC,F.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,F.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

18
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,F.ACCR.ACCT.CR,ACCT.CR.R.ERR)
CR.TOT.INT = AC.CR.REC<IC.ACRCR.TOTAL.INTEREST>
CALL F.READ(FN.ACCR.ACCT.DR,AC.ID,AC.DR.REC,F.ACCR.ACCT.DR,ACCT.DR.R.ERR)
DR.TOT.INT = AC.DR.REC<IC.ACRDR.TOTAL.INTEREST>
RETURN
END

19
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

20
STANDARD SELECTION Record

21
Enquiry Set Up

22
ENQUIRY Record

23
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

24
Sample Output

25
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.
o Routine type fields – These fields will have user type ‘R’
o Selection type fields – These fields will have user type‘S’

26
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 <delim>,<start pos>,<no. of pos> - is used to extract the data in
the ENQUIRY

27
© 2006 Thesys Technologies. All rights reserved.

28

You might also like