Intro To Template Programming
Intro To Template Programming
Warning: This document, is protected by copyright law and international treaties. 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 Unauthorized
reproduction or distribution of this presentation or any portion of it, may result in severe civil and
criminal penalties, and will be prosecuted to the maximum Copyright © 2004under
extent possible TEMENOS HOLDINGS
applicable law.” NV
Information in this document is subject to change without notice.
¾ Types of Template
APPLICATION PROGRAM
• Get data
• Stores data
¾ TEMPLATE
¾ TEMPLATE.L
¾ TEMPLATE.T
¾ TEMPLATE.W
5 COVER.AMOUNT 16,AMT Y
6 PREMIUM.AMOUNT 16,AMT Y
13 XX.LOCAL.REF
1 POLICY.TYPE.ID 7,A Y
4 RESERVED12-1 NOINPUT
Step 1:
Make a copy of the TEMPLATE program that is available in the
GLOBUS.BP directory on to your local directory (Example TRG.BP).
Ensure that you save the TEMPLATE program with a different name
(Insurance – Name of the application that we are to create).
jsh…>COPY FROM GLOBUS.BP TO DEV.BP TEMPLATE
jsh…>sh
jsh…>cd DEV.BP
jsh…>cd
jsh…>sh
jsh…>cd DEV.BP
Step 2:
Change the name of the template program to your application name
(Insurance).
Step 3:
Add the various fields that the Insurance application needs to contain
DEFINE.PARAMETERS:
Edit and add the necessary fields for our Insurance application.
*************************************************************************
RETURN
*************************************************************************
CALL INSURANCE.FIELD.DEFINITIONS
SUBROUTINE XX.FIELD.DEFINITIONS
$INSERT I_COMMON
$INSERT I_EQUATE
$INSERT I_F.CUSTOMER
*--------------------------------------------------------------------------
Paragraph to
GOSUB INITIALISE initialize variables
*--------------------------------------------------------------------------
DEFINE.FIELDS:
Actual field
definition
ID.F = "ID .NO" ; ID.N = "16" ; ID.T = "A"
Z=0
REM > Z+=1 ; F(Z) = "XX.XX.FIELD.NAME" ; N(Z) = "35.2" ; T(Z) = "A"
REM > Z+=1 ; F(Z) = "XX.XX.FIELD.NAME" ; N(Z) = "35.2" ; T(Z) = "A"
V=Z+9
RETURN
*-------------------------------------------------------------------------- V:Total number of fields in an
INITIALISE: application
Z:Number of fields defined
MAT F = "" ; MAT N = "" ; MAT T = "" V=Z+9 (To add 9 audit fields)
MAT CHECKFILE = "" ; MAT CONCATFILE = ""
ID.CHECKFILE = "" ; ID.CONCATFILE = ""
CHK.ACCOUNT = "ACCOUNT":FM:AC.SHORT.TITLE:FM:"L"
CHK.CUSTOMER = "CUSTOMER":FM:EB.CUS.SHORT.NAME:FM:'.A'
RETURN
---------------------------------------------------------------------------
END
Step 4:
Copy the skeleton program XX.FIELD.DEFINITIONS from GLOBUS.BP to BP
with the name INSURANCE.FIELD.DEFINITIONS
jsh…>sh
jsh…>cd DEV.BP
jsh…>cd
jsh…>sh
jsh…>cd DEV.BP
Step 5:
INSURANCE.FIELD.DEFINITIONS is ready
Field Attributes:
¾ F array
¾ N Array
¾ T Array
F Array:
To define the name of the field and to
specify if the field is a single value,
multi value or a sub value field. This
array also allows us to specify a field
as a language specific field.
¾ F array
¾ N Array
¾ T Array
N Array:
To define the maximum and minimum
number of characters a field can hold.
This array is also used to set a flag to
specify whether any other validations
apart from the data type validation
have to be performed or not.
¾ F array
¾ N Array
¾ T Array
T Array:
To define pick list for a field, if any.
Used to specify whether a field is a
NOINPUT field or a NOCHANGE field.
• A value ‘C’ in the third part of this array is used to signify that extra
validation has to be done for this field.
Element 1:
The first element of the T array is used to define the type of data
the field has to contain.
The value input for the 1st element refers to a suffix of an IN2
routine.
There are a number of IN2 routines existing in T24. Using these IN2 routines
we can restrict the type of data that is entered into a field.
IN2D Will accept input in any of several valid date formats. The date input
will be expanded to the full date YYYYMMDD and displayed as DD
MMM YYYY.
IN2AMT This routine accepts input of an amount and can edit the input to have
the number of decimal places defined for a specified currency.
Element 2:
The second element of the T array is used to define pick lists for a
field.
Incase the pick list for a field has to contain values of another field in another
Application, then a component called ‘CHECKFILE’ can be used.
Element 3:
The third element of the T array is used to make a field a NOINPUT or an
NOCHANGE field.
SUBROUTINE POLICY.TYPE.FIELD.DEFINITIONS
$INSERT I_COMMON
$INSERT I_EQUATE
GOSUB INITIALISE
GOSUB DEFINE.FIELDS
RETURN
DEFINE.FIELDS:
ID.F="POLICY.TYPE.ID";ID.N="7";ID.T=""
Z=0
Z+=1; F(Z)="XX.LL.DESCRIPTION";N(Z)="35.1"; T(Z)="A"
Z+=1; F(Z)="CATEGORY";N(Z)="5.1.C";T(Z)=""
Z+=1; F(Z)="RESERVED12";N(Z)="35..";T(Z)="A";T(Z)<3>='NOINPUT'
Z+=1; F(Z)="RESERVED11";N(Z)="35..";T(Z)="A";T(Z)<3>='NOINPUT'
Z+=1; F(Z)="RESERVED10";N(Z)="35..";T(Z)="A";T(Z)<3>='NOINPUT'
Z+=1; F(Z)="RESERVED9";N(Z)="35..";T(Z)="A";T(Z)<3>='NOINPUT'
Z+=1; F(Z)="RESERVED8";N(Z)="35..";T(Z)="A";T(Z)<3>='NOINPUT'
Z+=1; F(Z)="RESERVED7";N(Z)="35..";T(Z)="A";T(Z)<3>='NOINPUT'
Z+=1; F(Z)="RESERVED6";N(Z)="35..";T(Z)="A";T(Z)<3>='NOINPUT'
Z+=1; F(Z)="RESERVED5";N(Z)="35..";T(Z)="A";T(Z)<3>='NOINPUT'
Z+=1; F(Z)="RESERVED4";N(Z)="35..";T(Z)="A";T(Z)<3>='NOINPUT'
Z+=1; F(Z)="RESERVED3";N(Z)="35..";T(Z)="A";T(Z)<3>='NOINPUT'
Z+=1; F(Z)="RESERVED2";N(Z)="35..";T(Z)="A";T(Z)<3>='NOINPUT'
Z+=1; F(Z)="RESERVED1";N(Z)="35..";T(Z)="A";T(Z)<3>='NOINPUT'
V=Z+9
RETURN
INITIALISE:
jsh…> FILE.LAYOUT
Use Select List or Input Individually either :
List of FILE names from which to build insert modules via their dictionarys
List of PROGRAM names from which to build insert modules through calling.
Enter Program/File(s) :POLICY.TYPE
Enter Program/File(s) :
Program is POLICY.TYPE
SUBROUTINE INSURANCE.FIELD.DEFINITIONS
$INSERT I_COMMON
$INSERT I_EQUATE
$INSERT I_F.CUSTOMER
$INSERT I_F.CURRENCY
$INSERT BP I_F.POLICY.TYPE
GOSUB INITIALSE
GOSUB DEFINE.FIELDS
RETURN
DEFINE.FIELDS:
INITIALISE:
MAT F = "" ; MAT N = "" ; MAT T = ""
MAT CHECKFILE = "" ; MAT CONCATFILE = ""
ID.CHECKFILE = "" ; ID.CONCATFILE = ""
* Define often used check file variables
RETURN
END
Step 8:
Use the ‘Merge’ facility provided by jBASE and create the FILE.CONTROL record. Create
the FILE.CONTROL record for the POLICY.TYPE application
Jsh…>FILE.LAYOUT
Use Select List or Input Individually either :
List of FILE names from which to build insert modules via their dictionarys
List of PROGRAM names from which to build insert modules through calling.
Program is INSURANCE
Step 10:
The application CREATE.FILES is the one that looks into the
FILE.CONTROL record for the respective application and creates the
necessary files.
CREATE.FILES INSURANCE
INSURANCE$HIS
No Records selected
2 Records selected
No Records selected
2 Records selected
¾ AUTO.ID.START
¾ COMPANY.
Wokshop1