TEMENOS T24 DAS Guide
User Guide Amendmentt History: Amendmen
Revision
Date Amended
Name
Description
Draft
Dec 2006
Tony Porter
Initial version
1 .0
e! 200"
Tony Porter
DA# 2.0 $pdate
1 .1
%ar 200"
Tony Porter
&ptional fields
1 .2
'(ly 200"
Tony Porter
%ore notes and e)amples
No part of t*is doc(ment may !e reprod(ced or transmitted in any form or !y any means+ electronic or mec*anical+ for any p(rpose+ ,it*o(t t*e e)press ,ritten permission of T-%-N Holdins N/. opyri*t 200 T-%-N Holdins N/. All ri*ts reserved.
DA# (ide Table of Contents
Introd(ction....................................................................... ........................................ .......................... 3 DA# ro(tines...................................................................... ......................................... ........................ 4 DA#............................................... ........................................ ......................................... ................. 4 5R&$TIN-.NA%- DA#.tablename 7............................................................................................. DA# Inserts....................................................... ........................................ ..................................... ..... 6 I8DA#...................................................... ......................................... ..................................... .......... 6 I8DA#.tablename ....................................... ......................................... ............................................ " I8DA#.ta!lename.N&T-#.................................................................................................................." Addin DA# to e)istin code..................................... ........................................ .................................. 9 Analysis........................................................ ......................................... .......................................... 9 reatin DA# files.............................................. ......................................... .................................... 9 Definin (eries.............................................................. ......................................... .......................... ; Definin and (sin optional fields....................................................................................................; .? In a ,ildcard.....................................................................................................................10 -)amples.................................................................... ......................................... ............................. 11 DA#............................................... ........................................ ....................................... ................. 11
T-%-N T24 $ser (ide Pae 2 of 12
DA# (ide
Introduction T*e p(rpose of t*is doc(ment is to ive an overvie, of t*e DA# ro(tines and Inserts. -)amples are incl(ded ,*ere possi!le. T*ere is also a section s*o,in ,*at is re@(ired to add DA# to e)istin code.
T-%-N T24 $ser (ide Pae 3 of 12
DA# (ide
DAS routines DAS $se t*is ro(tine to process DA# @(eries. Parameters Ta!le name+ (ery list n(m!er + Ar(mentsB+ ta!le s(ffi) C .DI#PEAFGB Details T*is ro(tine ,ill ret(rn a @(ery list !ased on t*e @(ery list n(m!er and ta!le name s(pplied. alls 5R&$TIN-.NA%- DA#.tablename 7 ,*ic* does all t*e processin re@(ired to ret(rn t*e list of =eys. Previo(s /ersion of DA# Pass DI#&/-RG as t*e @(ery list n(m!er to ret(rn t*e @(ery strin calls 5R&$TIN-.NA%,it* .DI#PEAF as ta!le s(ffi) and passes it?s o,n AR list7 in t*e ta!le s(ffi). If t*e @(ery list does not e)ist+ $NN&N $-RFG is ret(rned !ac= in t*e @(ery list n(m!er. (rrent /ersion of DA# Passin DI#&/-R ,ill not ,or= at t*is point+ as t*e code *as !een removed from I8DA# ro(tines+ (se dasMode = dasReturnDescription !efore callin. -)ample 1 T*e follo,in code processes a DA# @(ery and ret(rns t*e res(lts. TABLE.NAME = DAS.L!ST = AR%&MENTS = TABLE.S&((!) = dasMode =
“SC.POS.ASSET.WORK.!S" dasScPosAssetWor#is!dEndsB$!d “T&ESDA'" “" * + e.,. “-!S" dasReturnResuts
CALL DAS/TABLE.NAME0 DAS.L!ST0 AR%&MENTS0 TABLE.S&((!)1 LOOP REMO2E DAS.!D (ROM DAS.L!ST SETT!N% DAS.MARK W!LE DAS.!D3DAS.MARK DO CRT “RES< (ROM 4&ER' 3 " 3 DAS.!D REPEAT
T-%-N T24 $ser (ide Pae 4 of 12
DA# (ide
@ROUTINENAME !DAStablename" Implements t*e @(ery definition for all @(eries t*at can !e (sed aainst t*e ta!le. $sed and called !y DA# ro(tine J t*ese ro(tines s*o(ld only !e created from a template. Parameters (ery list n(m!er + Ar(mentsB+ ta!le s(ffi)B Details T#is is created fro$ a te$%late
T*is ro(tine ,o(ld not (s(ally !e called !y code o(tside of a AEE DA#. If yo( ,ant to ret(rn t*e @(ery strin t*at DA# !(ilds+ set dasMode=dasReturnDescription and t*e select statement is ret(rned+ alon ,it* t*e description+ of t*e @(ery strin in t*e K(ery list n(m!erK parameter. If yo( ,ant to incl(de a ,ildcard in yo(r @(ery+ (se dasWidcard and not >L?. or e)ample TE.AR%S567 3 dasWidcard. T*e DA# ro(tine %$#T incl(de t*e follo,in internal ro(tine: BUILD.DATA:
T*is ,ill incl(de a case !loc= (sin a selection of t*e follo,in optionsL M'.(!ELDS M'.OPERANDS M'.DATA M'.8O!NS M'.SORT + E.%. 9B':DSND ;!D< M'.OPT!ONAL ADD.TO.CACE = /de>aut1 or 6
An e)ample of a simple A#- statement: CASE M'.CMD = dasScEntWor#!dE?uas * + A D!AR' e@cept drips price M'.(!ELDS = ;!D M'.OPERANDS = E4 M'.DATA = TE.AR%S567
An e)ample of a field Moin A#- statement : CASE M'.CMD = dasSc(ee%roupProrataE?ua * + ProrataE?ua pa$ent >ee ,roups M'.(!ELDS = PA'MENT 3 (M 3 PA'MENT M'.OPERANDS = E4 3 (M 3 E4 M'.DATA = PRORATA 3 (M 3 E4&AL M'.8O!NS = OR
-)ample T*e follo,in code displays t*e @(ery strin for a iven @(ery. 4&ER' = dasScPosAssetWor#is!dEndsB$!d AR%&MENTS = “T&ESDA'"
DasMode
= dasReturnDescription
CALL DAS.SC.POS.ASSET.WORK.!S/4&ER'0AR%&MENTS0 TABLE.S&((!)1 CRT “4&ER' TO E)EC&TE 3 “ 3 4&ER'567 CRT “DAS Description 3 “ 3 4&ER'57
dasMode = dasReturnResuts
T-%-N T24 $ser (ide Pae of 12
DA# (ide
DAS Inserts I&DAS ommon code for all Data Access #ervice ro(tines used internally by DAS only 7. Details #ets (p t*e dasA!ds DAS-ALL.!DS e@(ate to >AEE.ID#? !y incl(din I8DA#.&%%&N. T*is incl(de contains t*e code t*at is e)ec(ted in all 5R&$TIN-.NA%- DA#.ta!lename7 ro(tines. It first c*ec=s t*e cac*e+ if not fo(nd in t*e cac*e it calls t*e internal 5R&$TIN-.NA%- <$IED.DATA ro(tine+ t*en e)ec(tes its internal R$N.$-RF ro(tine ,*ic* invo=es t*e e)ternal -<.$-RF.<$IED-R ro(tine. If t*ere is an error+ t*e error is ret(rned !ac= in t*e @(ery list. If addin to t*e cac*e+ t*e res(lts are stored in DA#AH-Mavaf(llname e@(ate n(m!erO17. If cac*in dasAllIds t*en DA#AH-17 is (sed. Incl(des t*e follo,in internal ro(tines: !N!T!AL!SE CECK.CACE ADD.TO.CACE R&N.4&ER'
$sed in ro(tines 5R&$TIN-.NA%- DA#.ta!lename7
T-%-N T24 $ser (ide Pae 6 of 12
DA# (ide
I&DAS tablename Defines t*e named @(eries t*at can !e r(n aainst a ta!le+ t*is file m(st e)ist for a DA# @(ery. Details -ac* named @(ery m(st !e set(p as a A#- statement in 5R&$TIN-.NA%- DA#.ta!lename7. T*e named @(ery m(st !e defined in lo,ercase startin ,it* >das?+ t*en eac* ,ord startin ,it* an (ppercase c*aracter. T*e e@(ate n(m!er m(st start from 1 and increment in steps of 1. Fo( can not (se >0? as t*is ,o(ld interfere ,it* t*e DA#AH- (sed !y dasAllIds. T*ese incl(des are created from a template ,it* a comment !loc= precedin t*e e@(ates. If 'our DAS ite$ #as no na$ed (ueries !onl' re(uires dasAllIds" t#en t#is MUST e)ist *it#out an' e(uate assi+n$ents
-)ample +::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: + !nsert >or SC.POS.ASSET.WORK Data Access Serice. + :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: + De>ines tFe naed ?ueries tFat can Ge issued a,ainst SC.POS.ASSET.WORK taGe. + (or tFe ipeentation o> tFese ?ueries0 re>er to DAS.SC.POS.ASSET.WORK +::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: E4& dasScPosAssetWor#!dEndsB$!d TO 6 E4& dasScPosAssetWor#!dBe,insB$!d TO
I&DAStablena$eNOTES Defines t*e description for eac* named @(ery+ t*is file m(st e)ist for eac* DA# @(ery. Details T*ese incl(des are created from a template ,it* a comment !loc= precedin t*e array. If 'our DAS ite$ #as no na$ed (ueries !onl' re(uires dasAllIds" t#en t#is MUST e)ist *it#out an' DAS,NOTES assi+n$ents
-)ample +::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: + !nsert >or SC.POS.ASSET.WORK Data Access Serice. +::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: + De>ines tFe naed ?ueries tFat can Ge issued a,ainst tFe SC.POS.ASSET.WORK + taGe. + (or tFe ipeentation o> tFese ?ueries0 re>er to DAS.SC.POS.ASSET.WORK +::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: + 'ou M&ST Fae a diensioned arra$ >or DAS-CACE and DAS-NOTES +::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: COMMONDAS.SC.POS.ASSET.WORK DAS-CACE/610DAS-NOTES/61 +::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: DAS-NOTES/dasScPosAssetWor#!dEndsB$!d1 = Records HitF !D endin, in aue0 G$ !D
T-%-N T24 $ser (ide Pae " of 12
DA# (ide
Addin+ DAS to e)istin+ code Anal'sis Fo( ,ill need to do t*e follo,in. •
ind t*e #-E-T to replace in t*e code
•
Note t*e Ta!le Name
•
•
#earc* P/# to see if DA# ro(tines already e)ist+ if it does c*ec= to see if an e)istin @(ery fits yo(r needs. Never amend an e)istin @(ery (nless t*ere is a !( in t*e @(ery as e)istin code can !rea=+ it co(ld even rely on t*e data sent !ac= from t*e incorrect @(ery. If necessary7 reate a DA# Mava style varia!le name reflectin t*e p(rpose of t*e #-E-T if a ne, @(ery is to !e created.
Creatin+ DAS files reate t*e !ase DA# items to s(pport t*e #-E-T replacement if none e)ist in P/#+ ot*er,ise yo(?ll need to amend t*e P/# items. 1. reate t*e I8DA#.tablename item+ for e)ample I8DA#. FRA.DELIVERY (sin t*e I8DA#. template. 2. reate t*e I8DA#.tablename .N&T-# item+ for e)ample I8DA#. FRA.DELIVERY .N&T-# (sin t*e I8DA#..N&T-# template. 3. reate t*e DA#.tablename item+ for e)ample DA#. FRA.DELIVERY (sin t*e I8DA#. template. 4. Add yo(r #-E-T loic to t*e A#- statement in DA#. tablename .
T-%-N T24 $ser (ide Pae 9 of 12
DA# (ide
Definin+ -ueries Definin+ and usin+ o%tional fields To ma=e a field optional : M'.OPT!ONAL.(!ELDS5n7 = das!sAnOptiona(ied
In yo(r code ,*ere yo( call t*e DA# ro(tine+ if yo( don?t ,ant to incl(de it in t*e DA# ro(tine.. TE.AR%S5n7 = dasDoNot&seTFisOptiona(ied
Please note t*at a field m(st of already !een mar=ed as das!sAnOptiona(ied in t*e DA# @(ery+ ot*er,ise dasDoNot&seTFisOptiona(ied ,ill !e inored. T*is is to ens(re t*at t*e loic !e*ind t*e @(ery is not !ro=en Moins etc7.
.rac/ets DA# can *andle !rac=ets and ,ill ,arn yo( if t*ere is a mismatc* on closin or openin !rac=ets7+ to incl(de a !rac=et M(st prefi) it to t*e field and s(ffi) toe closin !rac=et to t*e data. M'.(!ELDS567 = ((!ELD.A M'.(!ELDS57 = (!ELD.B
T*en s(ffi) >7? on t*e last data fieldL M'.DATA567 = TE.AR%S567 M'.DATA57 = TE.AR%S57 3 )
ill constr(ct t*e strin similar toL SELECT (.(!LENAME W!T ((!ELD.A E4 AND (!ELD.B LT )
.rac/ets and o%tional fields *en (sin !rac=ets and optional fields+ care m(st !e ta=en on *o, any inored fields ,ill effect t*e loic of t*e Moins in t*e res(ltin #-E-T statement. DA# can *andle simple !rac=ets and optional fieldsL 1 &R 2 &R 37 AND 4 AND If all t*e a!ove ,ere optional+ t*e !rac=ets ,o(ld !e inserted correctly as re@(ired for any com!ination. 1 &R 27 AND 3 &R 477 AND If 3 ,as not (sed t*en 4 ,o(ld (se &R to Moin+ 1 &R 27 &R 4+ t *is is !eca(se DA# (ses t*e previo(s fields Moin.
T-%-N T24 $ser (ide Pae ; of 12
DA# (ide
Side notes Use an alternati0e table TH-.EI#TQ2 S ?AET-RNATI/-.TA
1assin+ $ulti%le data ite$s T*e feat(re e)ists in -<.$-RF.<$IED-R ,*ere yo( can pass a strin of data to em(late #-E-T file ITH field S AR1G AR2G AR3G. TH-.AR# S AR1G : 5/% : AR2G : 5/% : AR3G
Cac#in+ If TA
Usin+ 3 In a *ildcard If yo( are re@(ired to pass a >.? !efore a ,ildcard+ M(st incl(de it in t*e ar for e)ampleL. TH-.AR# S >123.? AEE DA# In DA#L. %F.DATASTH-.AR#Q1 : dasildcard ill prod(ce SELECT >ie W!T >ied L!KE 6I.... t*e @(ery ,ill r(n ,it* t*e last 3 dots as t*e ,ildcard.
T-%-N T24 $ser (ide Pae 10 of 12
DA# (ide
E)a$%les DAS -)ample 1. A minimal DA# item t*at only processes dasAllIds+ areas *i*li*ted ,o(ld need to !e amended for yo(r DA# item. Remember you will need I_DAS.tablename and I_DAS.tablename.NOTES created rom t!e tem"late. S&BRO&T!NE DAS.RELAT!ON/TE.L!ST0 TE.AR%S0 TABLE.S&((!)1 +::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: + DAS >or RELAT!ON +::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -!NSERT !JCOMMON -!NSERT !JE4&ATE -!NSERT !JDAS.RELAT!ON -!NSERT !JDAS.RELAT!ON.NOTES -!NSERT !JDAS +::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +++ 5re,ion nae= B&!LD.DATA7 B&!LD.DATA3 +++ BE%!N CASE CASE M'.CMD = dasA!ds
*+ Standard to return a #e$s
CASE OTERW!SE ERROR.MS% = &NKNOWN.4&ER' END CASE RET&RN +++ 5re,ion7 +::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:
-)ample 2. A simple @(ery *as !een added defined in I8DA#.ta!lename AND I8DA#.ta!lename.N&T-#7 to t*e a!ove code as *i*li*ted !elo,. Note t*e order of t*e varia!les ,*ic* ma=es it easier to read. S&BRO&T!NE DAS.RELAT!ON/TE.L!ST0 TE.AR%S0 TABLE.S&((!)1 +::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: + DAS >or RELAT!ON +::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -!NSERT !JCOMMON -!NSERT !JE4&ATE -!NSERT !JDAS.RELAT!ON -!NSERT !JDAS.RELAT!ON.NOTES -!NSERT !JDAS +::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +++ 5re,ion nae= B&!LD.DATA7 B&!LD.DATA3 +++ BE%!N CASE CASE M'.CMD = dasA!ds CASE M'.CMD M'.(!ELDS M'.OPERANDS M'.DATA
= = = =
*+ Standard to return a #e$s
dasReationReerseReation *+ ReerseReation as speci>ied RE2ERSE.RELAT!ON E4 TE.AR%S567
CASE OTERW!SE ERROR.MS% = &NKNOWN.4&ER' END CASE RET&RN +++ 5re,ion7 +::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
T-%-N T24 $ser (ide Pae 11 of 12
:
DA# (ide
-)ample 3. Anot*er @(ery *as !een added t*at c*ec=s t,o fields to t*e a!ove code as *i*li*ted !elo,. -ns(re t*at yo( *ave %F.'&IN# ,*en yo( *ave 2 or more fields. Remem!er to add t*e @(ery name to I8DA#.ta!lename and I8DA#.ta!elname.N&T-#. S&BRO&T!NE DAS.RELAT!ON/TE.L!ST0 TE.AR%S0 TABLE.S&((!)1 +::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: + DAS >or RELAT!ON +::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -!NSERT !JCOMMON -!NSERT !JE4&ATE -!NSERT !JDAS.RELAT!ON -!NSERT !JDAS.RELAT!ON.NOTES -!NSERT !JDAS +::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +++ 5re,ion nae= B&!LD.DATA7 B&!LD.DATA3 +++ BE%!N CASE CASE M'.CMD = dasA!ds
*+ Standard to return a #e$s
CASE M'.CMD = dasReationReerseReation *+ Reerse Reation as speci>ied M'.(!ELDS = RE2ERSE.RELAT!ON M'.OPERANDS = E4 M'.DATA = TE.AR%S567 CASE M'.CMD = dasReationReerseReation!dNe *+ Reerse Reation as speci>ied0 !D 57 speci>ied M'.(!ELDS = RE2ERSE.RELAT!ON 3 (M 3 ;!D M'.OPERANDS = E4 3 (M 3 NE M'.DATA = TE.AR%S567 3 (M 3 TE.AR%S57 MY.JOINS
= "AND"
CASE OTERW!SE ERROR.MS% = &NKNOWN.4&ER' END CASE RET&RN +++ 5re,ion7 +::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
T-%-N T24 $ser (ide Pae 12 of 12
: