DAS Guide

TEMENOS T24 DAS Guide User Guide Amendment History: Revision Date Amended Name Description Draft Dec 2006 Tony P

Views 126 Downloads 0 File size 398KB

Report DMCA / Copyright

DOWNLOAD FILE

Recommend stories

Citation preview

TEMENOS T24 DAS Guide

User Guide Amendment History:

Revision

Date Amended

Name

Description

Draft

Dec 2006

Tony Porter

Initial version

1.0

Feb 2007

Tony Porter

DAS 2.0 Update

1.1

Mar 2007

Tony Porter

Optional fields

1.2

July 2007

Tony Porter

More notes and examples

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 2005 TEMENOS Holdings NV. All rights reserved.

DAS Guide Table of Contents Introduction......................................................................................................................................... 3 DAS routines....................................................................................................................................... 4 DAS................................................................................................................................................. 4 @ROUTINE.NAME (DAS.tablename)............................................................................................. 5 DAS Inserts......................................................................................................................................... 6 I_DAS.............................................................................................................................................. 6 I_DAS.tablename............................................................................................................................ 7 I_DAS.tablename.NOTES.................................................................................................................. 7 Adding DAS to existing code............................................................................................................... 8 Analysis........................................................................................................................................... 8 Creating DAS files........................................................................................................................... 8 Defining Queries................................................................................................................................. 9 Defining and using optional fields.................................................................................................... 9 Brackets.......................................................................................................................................... 9 Brackets and optional fields............................................................................................................. 9 Side notes......................................................................................................................................... 10 Use an alternative table................................................................................................................. 10 Passing multiple data items........................................................................................................... 10 Caching......................................................................................................................................... 10 Using ‘.’ In a wildcard..................................................................................................................... 10 Examples.......................................................................................................................................... 11 DAS............................................................................................................................................... 11

TEMENOS T24 User Guide Page 2 of 12

DAS Guide

Introduction The purpose of this document is to give an overview of the DAS routines and Inserts. Examples are included where possible. There is also a section showing what is required to add DAS to existing code.

TEMENOS T24 User Guide Page 3 of 12

DAS Guide

DAS routines DAS Use this routine to process DAS queries. Parameters Table name, Query list number , {Arguments}, {table suffix | “.DISPLAY”} Details This routine will return a query list based on the query list number and table name supplied. Calls @ROUTINE.NAME (DAS.tablename) which does all the processing required to return the list of keys. Previous Version of DAS Pass “DISCOVER” as the query list number to return the query string (calls @ROUTINE.NAME with .DISPLAY as table suffix and passes it’s own ARG list) in the table suffix. If the query list does not exist, “UNKNOWN QUERY” is returned back in the query list number. Current Version of DAS Passing DISCOVER will not work at this point, as the code has been removed from I_DAS routines, use dasMode = dasReturnDescription before calling. Example 1 The following code processes a DAS query and returns the results. TABLE.NAME DAS.LIST ARGUMENTS TABLE.SUFFIX dasMode

= = = = =

“SC.POS.ASSET.WORK.HIS” dasScPosAssetWorkHisIdEndsById “TUESDAY” “” ; * e.g. “$HIS” dasReturnResults

CALL DAS(TABLE.NAME, DAS.LIST, ARGUMENTS, TABLE.SUFFIX) LOOP REMOVE DAS.ID FROM DAS.LIST SETTING DAS.MARK WHILE DAS.ID:DAS.MARK DO CRT “RESULT FROM QUERY : ” : DAS.ID REPEAT

TEMENOS T24 User Guide Page 4 of 12

DAS Guide

@ROUTINE.NAME (DAS.tablename) Implements the query definition for all queries that can be used against the table. Used and called by DAS routine - these routines should only be created from a template. Parameters Query list number , {Arguments}, {table suffix} Details This is created from a template. This routine would not usually be called by code outside of a CALL DAS. If you want to return the query string that DAS builds, set dasMode=dasReturnDescription and the select statement is returned, along with the description, of the query string in the `Query list number` parameter. If you want to include a wildcard in your query, use dasWildcard and not ‘…’. For example THE.ARGS : dasWildcard. The DAS routine MUST include the following internal routine: BUILD.DATA:

This will include a case block using a selection of the following options… MY.FIELDS MY.OPERANDS MY.DATA MY.JOINS MY.SORT * E.G. `BY-DSND @ID’ MY.OPTIONAL ADD.TO.CACHE = 0(default) or 1

An example of a simple CASE statement: CASE MY.CMD = dasScEntWorkIdEquals ; * All DIARY except drips price MY.FIELDS = '@ID' MY.OPERANDS = 'EQ' MY.DATA = THE.ARGS

An example of a field join CASE statement : CASE MY.CMD = dasScFeeGroupProrataEqual ; * Prorata/Equal payment fee groups MY.FIELDS = 'PAYMENT' : FM : 'PAYMENT' MY.OPERANDS = 'EQ' : FM : 'EQ' MY.DATA = 'PRORATA' : FM : 'EQUAL' MY.JOINS = 'OR'

Example The following code displays the query string for a given query. QUERY = dasScPosAssetWorkHisIdEndsById ARGUMENTS = “TUESDAY”

DasMode

= dasReturnDescription

CALL DAS.SC.POS.ASSET.WORK.HIS(QUERY,ARGUMENTS, TABLE.SUFFIX) CRT “QUERY TO EXECUTE : “ : QUERY CRT “DAS Description : “ : QUERY

dasMode = dasReturnResults

TEMENOS T24 User Guide Page 5 of 12

DAS Guide

DAS Inserts I_DAS Common code for all Data Access Service routines (used internally by DAS only). Details Sets up the dasAllIds / DAS$ALL.IDS equate to ‘ALL.IDS’ by including I_DAS.COMMON. This include contains the code that is executed in all @ROUTINE.NAME (DAS.tablename) routines. It first checks the cache, if not found in the cache it calls the internal @ROUTINE.NAME BUILD.DATA routine, then executes its internal RUN.QUERY routine which invokes the external EB.QUERY.BUILDER routine. If there is an error, the error is returned back in the query list. If adding to the cache, the results are stored in DAS$CACHE(javafullname equate number+1). If caching dasAllIds then DAS$CACHE(1) is used. Includes the following internal routines: INITIALISE CHECK.CACHE ADD.TO.CACHE RUN.QUERY

Used in routines @ROUTINE.NAME (DAS.tablename)

TEMENOS T24 User Guide Page 6 of 12

DAS Guide

I_DAS.tablename Defines the named queries that can be run against a table, this file must exist for a DAS query. Details Each named query must be setup as a CASE statement in @ROUTINE.NAME (DAS.tablename). The named query must be defined in lowercase starting with ‘das’, then each word starting with an uppercase character. The equate number must start from 1 and increment in steps of 1. You can not use ‘0’ as this would interfere with the DAS$CACHE used by dasAllIds. These includes are created from a template with a comment block preceding the equates. If your DAS item has no named queries (only requires dasAllIds) then this MUST exist without any equate assignments. Example *----------------------------------------------------------------------------* Insert for SC.POS.ASSET.WORK Data Access Service. * ---------------------------------------------------------------------------* Defines the named queries that can be issued against SC.POS.ASSET.WORK table. * For the implementation of these queries, refer to DAS.SC.POS.ASSET.WORK *----------------------------------------------------------------------------EQU dasScPosAssetWorkIdEndsById TO 1 EQU dasScPosAssetWorkIdBeginsById TO 2

I_DAS.tablename.NOTES Defines the description for each named query, this file must exist for each DAS query. Details These includes are created from a template with a comment block preceding the array. If your DAS item has no named queries (only requires dasAllIds) then this MUST exist without any DAS$NOTES assignments. Example *----------------------------------------------------------------------------* Insert for SC.POS.ASSET.WORK Data Access Service. *----------------------------------------------------------------------------* Defines the named queries that can be issued against the SC.POS.ASSET.WORK * table. * For the implementation of these queries, refer to DAS.SC.POS.ASSET.WORK *----------------------------------------------------------------------------* You MUST have a dimensioned array for DAS$CACHE and DAS$NOTES *----------------------------------------------------------------------------COMMON/DAS.SC.POS.ASSET.WORK/DAS$CACHE(100),DAS$NOTES(100) *----------------------------------------------------------------------------DAS$NOTES(dasScPosAssetWorkIdEndsById) = 'Records with ID ending in value, by ID'

TEMENOS T24 User Guide Page 7 of 12

DAS Guide

Adding DAS to existing code. Analysis You will need to do the following. 

Find the SELECT to replace in the code



Note the Table Name



Search PVCS to see if DAS routines already exist, if it does check to see if an existing query fits your needs. Never amend an existing query unless there is a bug in the query as existing code can break, it could even rely on the data sent back from the incorrect query.



(If necessary) Create a DAS java style variable name reflecting the purpose of the SELECT if a new query is to be created.

Creating DAS files Create the base DAS items to support the SELECT replacement if none exist in PVCS, otherwise you’ll need to amend the PVCS items. 1. Create the I_DAS.tablename item, for example I_DAS.FRA.DELIVERY using the I_DAS.XXX template. 2. Create the I_DAS.tablename.NOTES item, for example I_DAS.FRA.DELIVERY.NOTES using the I_DAS.XXX.NOTES template. 3. Create the DAS.tablename item, for example DAS.FRA.DELIVERY using the I_DAS.XXX template. 4. Add your SELECT logic to the CASE statement in DAS.tablename.

TEMENOS T24 User Guide Page 8 of 12

DAS Guide

Defining Queries Defining and using optional fields To make a field optional : MY.OPTIONAL.FIELDS = dasIsAnOptionalField In your code where you call the DAS routine, if you don’t want to include it in the DAS routine.. THE.ARGS = dasDoNotUseThisOptionalField Please note that a field must of already been marked as dasIsAnOptionalField in the DAS query, otherwise dasDoNotUseThisOptionalField will be ignored. This is to ensure that the logic behind the query is not broken (joins etc).

Brackets DAS can handle brackets (and will warn you if there is a mismatch on closing or opening brackets), to include a bracket just prefix it to the field and suffix toe closing bracket to the data. MY.FIELDS = '(FIELD.A' MY.FIELDS = 'FIELD.B' Then suffix ‘)’ on the last data field… MY.DATA = THE.ARGS MY.DATA = THE.ARGS : ')' Will construct the string similar to… SELECT F.FILENAME WITH (FIELD.A EQ '' AND FIELD.B LT '')

Brackets and optional fields When using brackets and optional fields, care must be taken on how any ignored fields will effect the logic of the joins in the resulting SELECT statement. DAS can handle simple brackets and optional fields… (X1 OR X2 OR X3) AND X4 AND X5 If all the above were optional, the brackets would be inserted correctly as required for any combination. ((X1 OR X2) AND (X3 OR X4)) AND X5 If X3 was not used then X4 would use OR to join, (X1 OR X2) OR X4, this is because DAS uses the previous fields join.

TEMENOS T24 User Guide Page 9 of 12

DAS Guide

Side notes Use an alternative table THE.LIST = ’ALTERNATIVE.TABLE’ (A DAS program name which reflects the functionality should be used in the DAS routine)

Passing multiple data items The feature exists in EB.QUERY.BUILDER where you can pass a string of data to emulate SELECT file WITH field = “ARG1” “ARG2” ARG3”. THE.ARGS = “ARG1” : @VM : “ARG2” : @VM : “ARG3”

Caching If TABLE.SUFFIX, MY.FIELDS, MY.OPERANDS, MY.DATA, MY.JOINS or MY.SORT contain data, no caching will be performed.

Using ‘.’ In a wildcard If you are required to pass a ‘.’ before a wildcard, just include it in the arg for example…. THE.ARGS = ‘123.’ CALL DAS In DAS…. MY.DATA=THE.ARGS : dasWildcard Will produce SELECT file WITH field LIKE '123'.... the query will run with the last 3 dots as the wildcard.

TEMENOS T24 User Guide Page 10 of 12

DAS Guide

Examples DAS Example 1. A minimal DAS item that only processes dasAllIds, areas highlighted would need to be amended for your DAS item. Remember you will need I_DAS.tablename and I_DAS.tablename.NOTES created from the template. SUBROUTINE DAS.RELATION(THE.LIST, THE.ARGS, TABLE.SUFFIX) *----------------------------------------------------------------------------* DAS for RELATION *----------------------------------------------------------------------------$INSERT I_COMMON $INSERT I_EQUATE $INSERT I_DAS.RELATION $INSERT I_DAS.RELATION.NOTES $INSERT I_DAS *----------------------------------------------------------------------------*** BUILD.DATA: *** BEGIN CASE CASE MY.CMD = dasAllIds

;* Standard to return all keys

CASE OTHERWISE ERROR.MSG = 'UNKNOWN.QUERY' END CASE RETURN *** *-----------------------------------------------------------------------------

Example 2. A simple query has been added (defined in I_DAS.tablename AND I_DAS.tablename.NOTES) to the above code as highlighted below. Note the order of the variables which makes it easier to read. SUBROUTINE DAS.RELATION(THE.LIST, THE.ARGS, TABLE.SUFFIX) *----------------------------------------------------------------------------* DAS for RELATION *----------------------------------------------------------------------------$INSERT I_COMMON $INSERT I_EQUATE $INSERT I_DAS.RELATION $INSERT I_DAS.RELATION.NOTES $INSERT I_DAS *----------------------------------------------------------------------------*** BUILD.DATA: *** BEGIN CASE CASE MY.CMD = dasAllIds CASE MY.CMD MY.FIELDS MY.OPERANDS MY.DATA

= = = =

;* Standard to return all keys

dasRelationReverseRelation ;* ReverseRelation as specified "REVERSE.RELATION" "EQ" THE.ARGS

CASE OTHERWISE ERROR.MSG = 'UNKNOWN.QUERY' END CASE RETURN *** *-----------------------------------------------------------------------------

TEMENOS T24 User Guide Page 11 of 12

DAS Guide

Example 3. Another query has been added that checks two fields to the above code as highlighted below. * Ensure that you have MY.JOINS when you have 2 or more fields. * Remember to add the query name to I_DAS.tablename and I_DAS.tabelname.NOTES. SUBROUTINE DAS.RELATION(THE.LIST, THE.ARGS, TABLE.SUFFIX) *----------------------------------------------------------------------------* DAS for RELATION *----------------------------------------------------------------------------$INSERT I_COMMON $INSERT I_EQUATE $INSERT I_DAS.RELATION $INSERT I_DAS.RELATION.NOTES $INSERT I_DAS *----------------------------------------------------------------------------*** BUILD.DATA: *** BEGIN CASE CASE MY.CMD = dasAllIds

;* Standard to return all keys

CASE MY.CMD = dasRelationReverseRelation ;* Reverse Relation as specified MY.FIELDS = "REVERSE.RELATION" MY.OPERANDS = "EQ" MY.DATA = THE.ARGS CASE MY.CMD = dasRelationReverseRelationIdNe ;* Reverse Relation as specified, ID specified MY.FIELDS = "REVERSE.RELATION" : FM : "@ID" MY.OPERANDS = "EQ" : FM : "NE" MY.DATA = THE.ARGS : FM : THE.ARGS

MY.JOINS

= "AND"

CASE OTHERWISE ERROR.MSG = 'UNKNOWN.QUERY' END CASE RETURN *** *-----------------------------------------------------------------------------

TEMENOS T24 User Guide Page 12 of 12