0% found this document useful (0 votes)
106 views9 pages

Enquiry Routines and Subroutines Guide

Uploaded by

othmanbenhalima1
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
106 views9 pages

Enquiry Routines and Subroutines Guide

Uploaded by

othmanbenhalima1
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd

ENQUIRY ROUTINES

DateOf Issue Version Changes By


2001 1.0 Initial Alagammai
Palaniappan
2002 1.1 jBASE Alagammai
changes Palaniappan
2004 1.2 Format and Alagammai
conversion Palaniappan
routine
changes
Information in this document is subject to change without notice.

No part of this document may be reproduced or transmitted in any form or by any means,
electronic or mechanical, for any purpose, without the express written permission of TEMENOS Holdings NV.

Copyright 2002-2003 TEMENOS Holdings NV. All rights reserved.


Enquiry Routines

Table of Content
Table of Content..................................................................................................................................... 1
Table of Content..................................................................................................................................... 2
Introduction............................................................................................................................................. 3
Types Of Enquiry Routines..................................................................................................................... 3
Build Routines..................................................................................................................................... 3
Conversion Routines........................................................................................................................... 6

TEMENOS Training Publications Page 2 of 9 July 2003


T3ATT – R05 – 1.0
Enquiry Routines

Introduction
As you would be aware by now an ENQUIRY is a question you ask the system about your data. They
are similar to select statements as they enables a user to extract data from single or multiple files in
addition to presenting complex data in any required format. As we are aware, subroutines are
programs that enable a user to read and write onto a single file or multiple files. These subroutines
when attached to enquiries, add more functionality to them. This chapter deals with the different types
of routines that can be attached to en enquiry.

Types Of Enquiry Routines


There are 2 types of enquiry routines namely
 Build routine and
 Conversion routine

Before we learn to write these subroutines it is vital for us to know about the file
‘I_ENQUIRY.COMMON’. It is an insert file like I_COMMON and I_EQUATE, but specific to enquiries
and contains common variables specific to enquiries. A commonly used variable in
I_ENQUIRY.COMMON is [Link]. We will learn more about it in the ‘NOFILE ENQUIRY’ section.

Build Routines
These are subroutines, which get invoked prior to the actual selection of records from the file and after
the user specify the selection criteria. They have to be attached to the field ‘BUILD ROUTINE’. This
routine must have one passed argument, which will contain the following:

ENQ<1> = NAME OF ENQUIRY


ENQ<2,1> = SELECTION FIELD NAMES (USER INPUT)
ENQ<3,1> = ASSOCIATED OPERANDS (EQ, LK etc.)
ENQ<4,1> = DATA LIST

The basic functionality of the passed argument is to alter the selection criteria when required.

TEMENOS Training Publications Page 3 of 9 July 2003


T3ATT – R05 – 1.0
Enquiry Routines

Example 1
Create an enquiry that will display Customer Id, the Account Id and the respective working balance
after accepting the category from the user.
For category 1001 - Balance should be in the range 10 and 50000
For category 6001 - Balance should be in the range 50000 and 100000
For categories greater than 7000 - Balance should be in the range 100000 500000

Solution 1
Step 1
Create an enquiry that will display the Customer Id, Account Id and the Working Balance from the
Account File.

[Link]
should also be
included in the
selection fields.

Step 2
Write a build routine that will extract the Category value entered in the Selection Criteria Box and
depending on the value of the Category will append a new condition to the Selection Criteria box,
which will check for the working balance.

Note :
When the user executes the enquiry, he would supply the category as well as the currency . It is our
responsibility to find out the exact position of the field category in the incoming array [Link] and
then extract the corresponding value of the field category.

TEMENOS Training Publications Page 4 of 9 July 2003


T3ATT – R05 – 1.0
Enquiry Routines

*This routine extracts the value (category value) from the incoming array
[Link] and *checks if it is in a specified range. If it is, then an
additional condition which will check for the working * balance is appended
to the selection criteria.
SUBROUTINE [Link]([Link])
$INSERT I_COMMON
$INSERT I_EQUATE
$INSERT I_ENQUIRY.COMMON

LOCATE 'CATEGORY' IN [Link]<2,1> SETTING [Link] ELSE NULL


[Link]=[Link]<4,[Link]>

LOCATE '[Link]' IN [Link]<2,1> SETTING [Link] ELSE NULL

[Link]<2,[Link]>='[Link]'
[Link]<3,[Link]>= 'RG'

IF [Link]=1001 THEN [Link]<4,[Link]>='0 49999'


IF [Link]=6001 THEN [Link]<4,[Link]>='50000 100000'
IF [Link]>7000 THEN [Link]<4,[Link]>='100000 500000'

RETURN
END

Step 3
Compile and catalogue the subroutine.

TEMENOS Training Publications Page 5 of 9 July 2003


T3ATT – R05 – 1.0
Enquiry Routines

Step 4
Attach the subroutine to the enquiry in the field [Link] in the enquiry application.

[Link]
should also be included in
the selection fields

Conversion Routines
Conversion routines are the ones that help us to manipulate the data in a field prior to display. They
are attached to the Conversion field in the Enquiry application. T24 gives us the flexibility of using any
of the pre-defined conversion routines or attaching user-defined routines. Let us understand it with an
example.
Before we proceed to the example, we need to understand the working of the Enquiry subsystem.
When an enquiry is executed, the enquiry selects all the ids from the file specified in the field
[Link] in the enquiry after applying the conditions specified in the filed [Link].
Then, once the dynamic selections are given using the Selection Criteria Box, these conditions are
applied to the set of ids(on which the FIXED SELECTION has been applied) and the Enquiry
subsystem forms a new set of ids. For each of these ids, the Enquiry Subsystem picks up the other
fields that have been defined in the ENQUIRY and displays them field-by-field. Therefore, it is very
important for us to understand that the enquiry subsystem picks up field-by-field and displays field by
field. Therefore, if we attach a Conversion routine to a field in the Enquiry, when the routine gets
executed, the last extracted value by the Enquiry subsystem at that moment will be the value of that
particular field. This last extracted value can be obtained from a common variable [Link] that is
defined in the file I_ENQUIRY.COMMON. This file I_ENQUIRY.COMMON is like the I_COMMON file,
just that it contains common variables for enquiries only and therefore the name
I_ENQUIRY.COMMON.

Example 2
Create an enquiry that will list the LD contract numbers, and their respective loan amounts. In case the
loan amounts are in foreign currency, they have to be converted to local currency and then displayed.
(Hint: Multiply the LD loan amount with the ‘[Link]’ in the CURRENCY file for that
particular currency to convert the foreign currency loan amount to local currency amount)

TEMENOS Training Publications Page 6 of 9 July 2003


T3ATT – R05 – 1.0
Enquiry Routines

Format of output required:

LD Contract Number Amount In Local Currency

Solution 2

Step 1
Create an enquiry that will list all the LD contract numbers and the loan amounts.

Step 2

Which Field Do We Attach This Routine?

In the above enquiry we display the LD ID and the Principal amount for each contract. If the principal
amount is in any other currency then we need to convert it to local currency equivalent. We could write
a conversion routine and attach it to the field ‘PRINCIPAL’ in the enquiry. The common variable
[Link] is capable of giving us the last extracted value. In this case, if we attach the routine to the
field PRINCIPAL, the last extracted value when the routine gets executed will be the PRINCIPAL
amount as the Enquiry application always extracts field by field and displays field by field. Using just
the PRINCIPAL amount we cannot know the currency. How do we get the currency? When the
Enquiry subsystem picks up the record pertaining to each ID, it stores the fetched record in a common
variable [Link]. So, the currency and all the other details of the current record can be obtained
from [Link].
So, we can attach the routine to the AMOUNT field and using a conversion routine, extract the
currency from [Link] and proceed with the necessary calculations.

Write a subroutine that will convert the foreign currency amounts to local currency amounts
Use the common variable [Link] to obtain the last extracted value and the common variable LCCY
to obtain the local currency of the bank.

TEMENOS Training Publications Page 7 of 9 July 2003


T3ATT – R05 – 1.0
Enquiry Routines

*This is a conversion routine attached to the AMOUNT field of the LD


*enquiry. This routine converts all LD amounts to local currency
*equivalents
SUBROUTINE [Link]
$INSERT I_COMMON
$INSERT I_EQUATE
$INSERT I_ENQUIRY.COMMON
$INSERT I_F.[Link]
$INSERT I_F.CURRENCY
GOSUB INIT
GOSUB PROCESS
RETURN
INIT:
[Link] = '[Link]'
[Link] = ''
[Link] = [Link]<[Link]>
[Link] = ‘’
CALL OPF([Link],[Link])
RETURN
PROCESS:
IF [Link] NE LCCY THEN
CALL [Link]([Link],[Link],[Link],[Link],LD.ERR1)
[Link] = [Link]<[Link],1> * [Link]
END
RETURN
END
In the above subroutine the loan amount, which is stored in [Link], is extracted and the respective
currency for that amount is fetched from the ‘[Link]’. If the fetched currency is
the same as the local currency then, the principal amount as it is in the LD file is passed to [Link]
else the ‘[Link]’ for that particular currency is extracted from the CURRENCY file and is
multiplied with the principal amount. This calculated value is then sent back to the enquiry through the
[Link] variable.

Step 3
Compile and catalogue the subroutine.

TEMENOS Training Publications Page 8 of 9 July 2003


T3ATT – R05 – 1.0
Enquiry Routines

Step 4
Attach the subroutine to the enquiry.

A conversion routine needs to be


prefixed with an @ followed by a single
space.

TEMENOS Training Publications Page 9 of 9 July 2003


T3ATT – R05 – 1.0

Common questions

Powered by AI

Conversion routines manipulate data fields by transforming the field values using logical computations before display. They are specifically attached to data fields in the Enquiry application to make such transformations. This includes tasks like currency conversion, where a routine takes a loan amount in foreign currency, retrieves the appropriate conversion rate from a CURRENCY file using R.RECORD and performs the multiplication to represent the amount in local currency. Such manipulation allows the system to standardize data displays according to specific business rules or user needs .

Subroutine compilation and cataloging are critical steps that ensure subroutine integrity and availability within the enquiry system. Compiling translates the high-level code into executable instructions, verifying its correctness and efficiency. Cataloging registers the subroutine with the system, making it discoverable and executable by specific enquiries. This process provides a structured environment where consistently updated routines can be reused, ensuring they integrate seamlessly into the broader enquiry framework .

The enquiry subsystem manages data extraction and display by picking and displaying each field individually using the predefined sequence in the enquiry setup. This systematic field-by-field processing allows developers to attach specific routines, such as conversion routines, to individual fields, ensuring that any data manipulation (e.g., currency conversion using the common variable O.DATA) takes place on an exact field basis, providing precise control over data presentation .

Pre-defined conversion routines in the TEMENOS system provide standardized data transformations, ensuring consistency and reducing the need for custom code across common operations. Meanwhile, user-defined routines afford flexibility, allowing financial institutions to extend or alter functionality to meet unique processing needs, such as bespoke currency conversions not covered by system defaults. This duality supports both uniformity and customization, crucial for complex financial operations .

Build routines in enquiry routines allow dynamic modification of selection criteria by processing user input before the actual data retrieval. For instance, by using a build routine, the system can append additional conditions based on user inputs, such as category values, to refine data selection. As shown in the example, a build routine can adjust the selection criteria to ensure that queries like account balance ranges adapt based on specific category parameters provided by the user .

In a build routine, category-based data conditions can be dynamically implemented by checking the category input by the user and appending corresponding balance range conditions to the selection criteria. For instance, with category 1001, the build routine sets balance requirements between 10 and 50000, for category 6001 between 50000 and 100000, and for any categories over 7000, between 100000 and 500000. This enables tailored data extraction based on comprehensive condition evaluations directly tied to user input .

The common variable O.DATA in conversion routines holds the last extracted value of a field by the enquiry subsystem before display. This variable is crucial in conversion routines because it allows the programmer to capture and manipulate the exact value of a field, such as converting currency amounts to a local equivalent before the information is presented to users .

User-input-based dynamic selection in enquiry routines is achieved through build routines that process and incorporate user inputs into selection criteria before executing the query. For example, user-provided category information can trigger different selection conditions for account balances through a build routine, dynamically shaping the data retrieval based on parameters provided at runtime. This allows for highly customized data extraction tailored to specific business needs .

The file I_ENQUIRY.COMMON serves as a repository for variables specific to enquiries in the TEMENOS system. It contains shared variables, such as O.DATA, used across different routines to facilitate consistent data access and manipulation within enquiries. This file is instrumental in ensuring that routines can universally access and modify enquiry-related data without conflicts, thus maintaining the integrity and usability of the enquiry functionalities .

To write and attach a conversion routine to an enquiry, follow these steps: First, identify the field requiring manipulation, such as converting currency values. Write a subroutine capturing necessary data transformations, using R.RECORD to obtain all relevant field details. After coding and testing the routine, compile and catalogue it. Finally, attach the subroutine to the appropriate field within the enquiry system application, ensuring it's run whenever the specified data field is processed .

You might also like