Subroutine Guide
Subroutine Guide
Subroutine Guide
Introduction
This guide contains a list of the subroutines used most frequently by T24 applications and
those which are most likely to be of use to developers on client sites. Wherever a
subroutine is provided to perform a specified task, the subroutine provided should be
used.
Temenos reserves the right to modify the following routines as and when required.
However, where possible, any such changes and the impact upon the use of the
subroutines will be documented.
Date Routines
CDD
Incoming
REGION Region code
DATE1 Start date, YYYYMMDD
DATE2 End date, YYYYMMDD
DAYS 'W' to indicate working days
'C' to indicate calendar days
Returned
DAYS The number of days difference, + or -
CDT
Incoming
REGION Region code
DATE Start date, YYYYMMDD
DAYS The number of days forward in the format
+ or -, the number of days, working or
calendar eg. +99C, -6W, +66W+3C
Returned
DATE The calculated date
ETEXT Error message if unsuccessful
CFQ
Incoming:
COMI YYYYMMDDXXXXX where XXXXX is the
frequency code.
Returned:
DIETER.DATE
Incoming:
Note that both DIETER and PRIME DATES cannot be passed. One date is mandatory
Returned:
JULDATE
Arguments: GREGORIAN.DATE,JULIAN.DATE
Incoming:
One of the above dates must be passed to the subroutine; the other date must be null.
Returned:
Exchanges Rates
CALC.ERATE.LOCAL
Incoming:
Returned:
CUSTRATE
Arguments: CCY.MARKETS,
BUY.CCY,BUY.AMT,SELL.CCY,SELL.AMT,
BASE.CCY,TREASURY.RATE,CUST.RATE,CUST.SPREA
D,
SPREAD.PCT,LOCAL.CCY.BUY,LOCAL.CCY.SELL,
RETURN.CODE
Incoming:
CCY.MARKETS Is a multi-valued field containing the markets for the buy and
sell side. This parameter needs be multi-valued only for Multi
Market. For all cases where the buy and sell markets are the
same, CCY.MARKETS should be a single value only. In case
of two markets, the format should be:
BUY.CCY.MKT:VM:SELL.CCY.MKT.
BUY.CCY and These are the currencies that will be involved in the transaction
SELL.CCY
BUY.AMT and These are the amounts that will be involved in the transaction.
SELL.AMT Only one is passed to the routine. The other is calculated from
it and the customer rate
BASE.CCY This is the currency in terms of which the RATES will be
expressed
TREASURY.RATE This is the rate at which the TREASURY will exchange the
currencies
CUSTOMER.RATE The rate at which the currencies will be exchanged for the
customer
CUSTOMER.SPREA The difference between the TREASURY.RATE and the
D CUSTOMER.RATE
SPREAD.PCT The percentage of the default CUSTOMER.SPREAD to be
used in calculating the CUSTOMER.RATE
Of the above parameters, only CCY.MARKETS, BUY/SELL CCY and one amount are
mandatory. The other amount must be blank and only 1 of the CUSTOMER fields may
have a value. NOTE: Only one CURRENCY.MARKET is mandatory.
Returned:
EXCHRATE
Arguments: CCY.MKT,BUY.CCY,BUY.AMT,SELL.CCY,
SELL.AMT,BASE.CCY,EXCHANGE.RATE,
DIFFERENCE,LCY.AMT,RETURN.CODE
Incoming:
CCY.MKT The currency market in which the transaction
will take place
BUY.CCY and The currencies that will be involved in the
SELL.CCY transaction
BUY.AMT and The amounts that will be involved in the
SELL.AMT transaction
BASE.CCY The currency in terms of which the
EXCHANGE.RATE will be expressed
EXCHANGE.RATE The rate of exchange between the two
currencies
If any of these fields, with exception of BUY/SELL CCY and CCY.MKT are left blank,
then they will be filled in by the routine if at all possible
Returned:
FCY.CONVERT.CHECK
Incoming:
Returned:
MIDDLE.RATE.CONV.CHECK
Incoming:
Returned:
Incoming:
'.' separator
'.' separator
'.' separator
Returned:
OPF
Description: File open routine. Handles company
modification of file name hence, it must be
called for all file opens.
Incoming:
Returned:
EB.CLEAR.FILE
Arguments: (FILE.VAR)
Incoming:
Returned:
F.DELETE
Incoming:
Returned:
F.MATREAD
Incoming:
Returned:
ARY Dimensioned array (data record)
ER Error message
F.MATREADU
Incoming:
Returned:
Format of RETRY
argument
P msg Prompt the user with 'msg' if the record is
locked. The default if 'msg' is null is 'xxxxx
FILE id RECORD LOCKED - RETRY Y/N'
R nn xx Retry xx times with a sleep interval of nn
seconds. If xx is not specified the record is
continually retried.
I Ignore the lock (REC or ARY is left as null)
E Return immediately with an error message
null Retry continuously with a sleep interval of one
second
F.MATWRITE
Incoming:
Returned:
F.LIVE.MATWRITE
Incoming:
Returned:
F.READ
Incoming:
Returned:
F.READU
Incoming:
Returned:
Format of RETRY
argument
P msg Prompt the user with 'msg' if the record is
locked. The default if 'msg' is null is 'xxxxx
FILE id RECORD LOCKED - RETRY Y/N'
R nn xx Retry xx times with a sleep interval of nn
seconds. If xx is not specified the record is
continually retried
I Ignore the lock (REC or ARY is left as null)
E Return immediately with an error message
null Retry continuously with a sleep interval of one
second
F.READV
Incoming:
F.WRITE
Incoming:
Returned:
F.LIVE.WRITE
Incoming:
Returned:
LCK
Incoming:
Arguments: None
Incoming:
Standard common
variables
Returned:
Cleared system write cache and lock table (except current transaction
id)
Validation
DUP
Arguments: None
Incoming:
Returned:
FT.NULLS.CHK
Arguments: None
Incoming:
Returned:
STORE.END.ERROR
Incoming:
LIMIT.GET.PRODUCT
Inward
YR.SYSTEM The Limit Parameter record for the application
(Optional)
YCUST.NO The customer number of the transaction
(Mandatory)
YCCY The currency of the transactions (Mandatory)
YPRODUCT The limit reference and serial number if supplied
in the transaction
Optional additional fields are:
<2> "DEPOSIT" denoting this is a deposit
contract
Or "INFO" denoting this is an information type
contract
<3> Any hard coded suffix passed from the
application. This will be combined with the
application name when searching
LIMIT.PARAMETER for relevant conditions if
supplied
APPLICATION The common variable contains the name of the
application to be looked up in the
LIMIT.PARAMETER record.
R.NEW The content of the current record to be used in
the look up of LIMIT PARAMETER
Returned
YR.SYSTEM The limit parameter applicable to the
APPLICATION
YR.PRODUCT Null – no product found or the value of the limit
reference for the Product
ETEXT Description of the error found
The routine should be called in the cross-validation phase of the contract only.
Template Programming
REBUILD.SCREEN
Arguments: None
Incoming:
Returned:
Arguments: (CURR.NO)
AF – from I_COMMON
AV - from I_COMMON
AS - from I_COMMON
TEXT - from I_COMMON
Incoming:
Returned:
Translation
APP.STATIC.TEXT
Incoming:
KEY ID of F.STATIC.TEXT record.
Returned:
TXT
Arguments: (MESSAGE)
Incoming:
Returned:
Messages
ERR
Arguments:
E From I_COMMON
OVE
Incoming:
Returned:
REM
Incoming:
TXTINP
Arguments: (YTEXT,C2,L2,N1,T1)
Incoming:
Returned:
COMI Contains the entered value
Generic
B.UPDATE.BATCH
Incoming:
Returned:
CALCULATE.CHARGE
Incoming:
Returned:
Notes:
The term 'charge' is used to denote charges, commissions and tax. The charge codes
should be defined on FT.CHARGE.TYPE , FT.COMMISSION.TYPE and TAX .
If the charge type is not passed then the routine will endeavour to determine the type by
reading the CHARGE, COMMISSION and TAX files in sequence.
Tax can be applied on a charge, hence you could get more charges returned than were
passed. All identical charge codes are consolidated before returning, i.e. if all four
charges had VAT applied then you would only get one VAT amount returned.
When performing ANY currency conversion between the DEAL.CURRENCY and the
CROSS.CURRENCY, the CROSS.RATE will be used; otherwise the mid-rate will be
used.
The customer conditions are optional and allow you to debit an individual customer a
percentage of the normal charge or an agreed flat rate, overriding the charge table
definitions. e.g. Specific customers may be charged 50% commission on certain deals.
E.GET.LOCAL.AMT
Arguments: (O.DATA)
Incoming:
Outgoing:
Arguments: None
Incoming:
Returned:
EB.FORMAT.RATE
Arguments: RATE
Incoming:
Returned:
EB.LOCREF.SETUP
Incoming:
Returned:
EB.READLIST
Incoming:
Returned:
KEY.LIST Selected list returned
EB.ROUND.AMOUNT
Arguments: CURRENCY.ID,AMOUNT,CAL,CUSTOMER.ID
Incoming:
Returned:
EXCHRATE
FATAL.ERROR
Arguments: (ROUTINE)
TEXT from I_COMMON
Incoming:
Returned:
The routine does not return to the program: the program aborts.
GET.NARRATIVE
Incoming:
Returned:
GET.SETTLEMENT.DEFAULTS
Incoming:
GET.SETTLEMENT.DEFAULTS (continued)
Returned:
GET.STANDARD.SELECTION.DETS
Incoming:
Returned:
LIMIT.CURR.CONV
Incoming:
Returned:
LOAD.COMPANY
Arguments: (COMPANY)
Incoming:
Returned:
Arguments: (N, T)
COMI from I_COMMON
Incoming:
Returned:
OFS.GLOBUS.MANAGER
Arguments: (K.OFS.SOURCE,OFS.MESSAGE)
Incoming:
Returned:
K.OFS.SOURCE Key to OFS.SOURCE record where
SOURCE.TYPE field is set to T24.
PRO
Arguments: (MESSAGE)
Incoming:
SC.CALC.YIELD
Incoming:
POTH.CCY.OR.COMMITM
This argument is only used for Forex or
Commitment contracts. For FX deals the other
(sell) currency of the transaction should be passed,
this corresponds to the amount in PTXN.AMT<2>.
For loan transactions linked to a commitment this
describes how the limit is to be impacted with
regard to the commitment.
Possible values are:
Y – Commitment contract
YR – Revolving Commitment contract
YN – Non revolving commitment contract
NR – Do not reduce online limit
Possible values:
Null Normal on-line process, override
requires response
U Used in BATCH mode, always
update overrides
Returned:
The limit check subroutine should be called at the unauthorised stage of transaction
process (i.e. in the BEFORE.UNAUTH.WRITE section of the template). It should be
called AFTER any call to the accounting process (EB.ACCOUNTING) to avoid any
potential locking order conflicts.
New transactions
The new values of currency, amount and maturity date should be passed with a
PCALL.ID value of "VAL”. This will add the new unauthorised values of the transaction.
The old values of currency and maturity date should be passed with a PCALL.ID value of
“DEL”. Take care to establish the correct old values, these can be found in the following
common arrays:
The old values of currency and maturity date should be passed with a PCALL.ID value of
“DEL”. Take care to establish the correct old values, these can be found in the following
common arrays:
A call of type DEL must be made first to remove the previous values (see deletion of
unauthorised transactions). New values should be supplied with a call type of VAL as per
new transactions.
HOLD processing
The HLD function should be disabled (apart from 1 st Input of the transaction) to avoid
corruption of the limits database. This should be done by adding the value .NOH to the
ADDITIONAL.INFO field of the application PGM.FILE record.
Principal Increase
The limits system will usually reflect the worst case scenario, so any principal increase,
forward dated or not, should impact the limits system immediately and not during the
Close of Business process.
Maturity of contracts should result in a call to LIMIT.CHECK with DEL to remove the
transaction from the limit system.
When the decrease takes place in the Close of Business, the system should call
LIMIT.CHECK first to delete the previous values, then to replace with the new principal.
Printing
PST
Arguments: (ACTION)
Incoming:
Returned:
Incoming:
PRINTER.OFF
Arguments: None
PRINTER.CLOSE
Incoming:
Incoming:
Returned:
SPOOL.REPORT
Incoming: