Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
DAS Guide
User Guide
Amendment History:
Revision
Date Amended
Name
Description
Draft
Dec 2006
Tony Porter
Initial version
1.0
Feb 2007
Tony Porter
1.1
Mar 2007
Tony Porter
Optional fields
1.2
July 2007
Tony Porter
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
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.
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 its 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
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<1> : 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
Example
The following code displays the query string for a given query.
QUERY
= dasScPosAssetWorkHisIdEndsById
ARGUMENTS = TUESDAY
DasMode
= dasReturnDescription
dasMode = dasReturnResults
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)
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'
DAS Guide
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.
DAS Guide
Defining Queries
Defining and using optional fields
To make a field optional :
MY.OPTIONAL.FIELDS<n> = dasIsAnOptionalField
In your code where you call the DAS routine, if you dont want to include it in the DAS routine..
THE.ARGS<n> = 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<1> = '(FIELD.A'
MY.FIELDS<2> = 'FIELD.B'
Then suffix ) on the last data field
MY.DATA<1> = THE.ARGS<1>
MY.DATA<2> = THE.ARGS<2> : ')'
Will construct the string similar to
SELECT F.FILENAME WITH (FIELD.A EQ '' AND FIELD.B LT '')
DAS Guide
Side notes
Use an alternative table
THE.LIST<2> = ALTERNATIVE.TABLE
(A DAS program name which reflects the functionality should be used in the DAS routine)
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<1> : dasWildcard
Will produce SELECT file WITH field LIKE '123'.... the query will run with the last 3 dots
as the wildcard.
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
*----------------------------------------------------------------------------*** <region name= BUILD.DATA>
BUILD.DATA:
***
BEGIN CASE
CASE MY.CMD = dasAllIds
CASE OTHERWISE
ERROR.MSG = 'UNKNOWN.QUERY'
END CASE
RETURN
*** </region>
*-----------------------------------------------------------------------------
=
=
=
=
CASE OTHERWISE
ERROR.MSG = 'UNKNOWN.QUERY'
END CASE
RETURN
*** </region>
*-----------------------------------------------------------------------------
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
*----------------------------------------------------------------------------*** <region name= BUILD.DATA>
BUILD.DATA:
***
BEGIN CASE
CASE MY.CMD = dasAllIds
MY.JOINS
= "AND"
CASE OTHERWISE
ERROR.MSG = 'UNKNOWN.QUERY'
END CASE
RETURN
*** </region>
*-----------------------------------------------------------------------------