No File Enquiries

Embed Size (px)

Citation preview

  • 8/11/2019 No File Enquiries

    1/25

    07 January 2005

    Creating NOFILE Enquiries

  • 8/11/2019 No File Enquiries

    2/25

    07 January 2005

    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

    Agenda

  • 8/11/2019 No File Enquiries

    3/25

    07 January 2005

    Knowledge on the working of the ENQUIRY

    application

    Info BASIC programming skills

    Prerequisites

  • 8/11/2019 No File Enquiries

    4/25

    07 January 2005

    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

    Why NOFILE Enquiry ?

    File 1 File 2 File 3 File 4

    Routine

    No connection between Files cannot be linked in ENQUIRYComplex calculations that are not supported by the ENQUIRY application

  • 8/11/2019 No File Enquiries

    5/25

    07 January 2005

    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

  • 8/11/2019 No File Enquiries

    6/2507 January 2005

    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 Selection type fields

  • 8/11/2019 No File Enquiries

    7/2507 January 2005

    Components of a NOFILE Enquiry are

    Info BASIC routine

    STANDARD.SELECTION record ENQUIRY record

    Setting up a NOFILE Enquiry

  • 8/11/2019 No File Enquiries

    8/2507 January 2005

    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 futuredate)

    Accrued interest that is due to the customer (total)

    Accrued interest that the customer is liable to pay (total)

    NOFILE Enquiry Example

  • 8/11/2019 No File Enquiries

    9/2507 January 2005

    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

    Files To Be Used

  • 8/11/2019 No File Enquiries

    10/2507 January 2005

    Solution 1 - Algorithm

    For the customer number supplied, extract record from CUSTOMER.ACCOUNT

    AC1FMAC2FMAC3FMAC4

    Read ACCT.ENT.FWD with the Account ID

    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

    Extract the next ID and process

    All F STMT

    entries have

    beenprocessed

  • 8/11/2019 No File Enquiries

    11/2507 January 2005

    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

    PrFstDateFMPrLstDtFMDrIntDateFMDrNoOfDaysFM..TotalInterest

    Total Debit Interest += Total Interest

    Get back to

    next accountConcatenate values in return parameter: Account ID,Tot

    Fwd Dr,Tot Fwd Cr,Total Dr Int,Tot Cr Int

  • 8/11/2019 No File Enquiries

    12/2507 January 2005

    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

  • 8/11/2019 No File Enquiries

    13/2507 January 2005

    *--------------*

    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

  • 8/11/2019 No File Enquiries

    14/2507 January 2005

    *----------*

    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

  • 8/11/2019 No File Enquiries

    15/2507 January 2005

    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

  • 8/11/2019 No File Enquiries

    16/2507 January 2005

    *------------*

    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

    CALLF.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 THENDR.AMT += ABS(ACCT.ENT.AMT)

    END ELSE

    CR.AMT += ACCT.ENT.AMT

    END

    Routine for the NOFILE Enquiry

  • 8/11/2019 No File Enquiries

    17/25

  • 8/11/2019 No File Enquiries

    18/25

    07 January 2005

    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

  • 8/11/2019 No File Enquiries

    19/25

    07 January 2005

    STANDARD SELECTION Record

    Routine Type

    Selection Type

  • 8/11/2019 No File Enquiries

    20/25

    07 January 2005

    Enquiry Set Up

    Must be a valid record from

    STANDARD.SELECTION

    Application. In this case, muststart with NOFILE.

  • 8/11/2019 No File Enquiries

    21/25

    07 January 2005

    ENQUIRY Record

    Using this we can access eachline 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 ,,

  • 8/11/2019 No File Enquiries

    22/25

  • 8/11/2019 No File Enquiries

    23/25

    07 January 2005

    Sample Output

  • 8/11/2019 No File Enquiries

    24/25

    07 January 2005

    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, withan 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 typeS

  • 8/11/2019 No File Enquiries

    25/25

    07 J 2005

    Summary (Cont.)

    Selection fields defined, can be used within the routineusing the COMMON variables D.FIELDS andD.RANGE.AND.VALUES defined in

    I_ENQUIRY.COMMON

    A routine written for NOFILE enquiry purposes shouldreturn one parameter

    The ENQUIRY application uses the ID of the STANDARD.SELECTION in the FILE.NAME field

    F ,, - is used to extract thedata in the ENQUIRY