Download as pdf or txt
Download as pdf or txt
You are on page 1of 15

Multithreaded Routines – Workshop Solution

Information in this document is subject to change without notice.

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.
Multithreaded Routines– Workshop Solutions

Table of Content
Table of Content ...................................................................................................................................... 2
Workshop 1 ............................................................................................................................................. 3
Workshop Solution 1 ............................................................................................................................ 3
Step 1 ............................................................................................................................................... 3
Step 2 ............................................................................................................................................... 4
Step 3 ............................................................................................................................................... 4
Step 4 ............................................................................................................................................... 4
Step 5 ............................................................................................................................................... 4
Step 6 ............................................................................................................................................... 5
Step 7 ............................................................................................................................................... 6
Step 8 ............................................................................................................................................... 6
Step 9 ............................................................................................................................................... 7
Step 10 ............................................................................................................................................. 7
Step 11 ............................................................................................................................................. 8
Step 12 ............................................................................................................................................. 9
Workshop 2 ............................................................................................................................................. 9
Workshop Solution 2 .......................................................................................................................... 10
Step 1 ............................................................................................................................................. 10
Step 2 ............................................................................................................................................. 10
Step 3 ............................................................................................................................................. 12
Step 4 ............................................................................................................................................. 12
Step 5 ............................................................................................................................................. 13
Step 6 ............................................................................................................................................. 13
Step 7 ............................................................................................................................................. 13
Step 8 ............................................................................................................................................. 14

TEMENOS Training Publications Page 2 of 15


T3TCM
Multithreaded Routines– Workshop Solutions

Workshop 1
An external interface is writing information in order to raise FUNDS.TRANSFER’s in T24. The
interface writes the ID’s in an ACTIVATION FILE named F.CREATE.FT.LIST and the actual message
is dumped in another file named F.ACTUAL.FT.MSG
F.CREATE.FT.LIST is a JR file, and F.ACTUAL.FT.MSG is an UD File.
A sample record id in F.CREATE.FT.LIST will be FT1 and the contents will be FT1, FT2 and its
contents FT2, so on and so forth. Basically this file will only contain the ID’s.
A sample record ID in F.ACUTAL.FT.MSG file will be FT1 and the contents will be
AC,22117,AUD,123,14524 i.e. all the details required to raise an Account to Account type FT
transaction in T24 (TRANSACTION.TYPE, DEBIT.ACCT.NO, DEBIT.CURRENCY, DEBIT.AMOUNT,
CREDIT.ACCT.NO)
You will have to write a Multithreaded routine that picks up the ID from the activation file, reads the
corresponding record from the ACTUAL.FT.MSG file and then calls OFS.POST.MESSAGE in order to
raise a FT Transaction. Make this multithreaded routine run as a service BNK/CREATE.FT

Workshop Solution 1
Step 1

Create the files and enter records in them


F.CREATE.FT.LIST

F.ACTUAL.FT.MSG

Create records in F.CREATE.FT.LIST

TEMENOS Training Publications Page 3 of 15


T3TCM
Multithreaded Routines– Workshop Solutions

Create records in F.ACTUAL.FT.MSG

Step 2

Create FILE.CONTROL record for the activation file i.e. F.CREATE.FT.LIST

Step 3

Create the Insert file I_CREATE.FTS.COMMON


COM/CREATE.FTS/FILE.NAME ,;*THIS CONTAINS THE UD FILE NAME
OFS.SOURCE.ID ;this is the ofs source record to be used

Step 4

Write the LOAD routine


SUBROUTINE CREATE.FTS.LOAD
$INSERT I_CREATE.FTS.COMMON
FILE.NAME = "F.ACTUAL.FT.MSG"
OFS.SOURCE.ID = "CREATE.FT"
RETURN
END

Step 5

TEMENOS Training Publications Page 4 of 15


T3TCM
Multithreaded Routines– Workshop Solutions

Write the RECORD routine as there will be no .SELECT routine. You will have to use sequential file
commands to read a record from the UD file F.ACTUAL.FT.MSG
SUBROUTINE CREATE.FTS(REC.NAME)
$INSERT I_CREATE.FTS.COMMON

OPENSEQ FILE.NAME,REC.NAME TO SEQ.FP ELSE


CREATE SEQ.FP ELSE
CRT "UNABLE TO CREATE FILE POINTER"
STOP
END
END
READSEQ FT.REC FROM SEQ.FP THEN
TXN.TYPE = FT.REC[',',1,1]
DEBIT.AC.NO = FT.REC[',',2,1]
DEBIT.CURR = FT.REC[',',3,1]
DEBIT.AMT = FT.REC[',',4,1]
CREDIT.AC = FT.REC[',',5,1]
OFS.REC = "FUNDS.TRANSFER,/I/PROCESS,AUTHOR/456456,,"
OFS.REC :="TRANSACTION.TYPE=":TXN.TYPE:","
OFS.REC :="DEBIT.ACCT.NO=":DEBIT.AC.NO:","
OFS.REC :="DEBIT.CURRENCY=":DEBIT.CURR:","
OFS.REC :="DEBIT.AMOUNT=":DEBIT.AMT:","
OFS.REC :="CREDIT.ACCT.NO=":CREDIT.AC
CALL OFS.POST.MESSAGE(OFS.REC,OFS.MSG.ID,OFS.SOURCE.ID,OPTIONS)
END ELSE
CRT "UNABLE TO READ"
END
CLOSESEQ SEQ.FP
END

Step 6

Make an entry in PGM.FILE for the above multithreaded routine. Name ID will be CREATE.FTS

TEMENOS Training Publications Page 5 of 15


T3TCM
Multithreaded Routines– Workshop Solutions

Step 7

Make an entry in BATCH for the service BNK/CREATE.FT

Step 8

Make an entry in TSA.SERVICE for the service BNK/CREATE.FT. Set the service control field to
START

TEMENOS Training Publications Page 6 of 15


T3TCM
Multithreaded Routines– Workshop Solutions

Step 9

Create a record in OFS.SOURCE with type as GLOBUS with ID as CREATE.FT

Step 10

Star the TSM and the required agents. Check the F.OFS.MESSAGE.QUEUE. Make sure that the
OFS.STRING is created there. Start the OFS.MESSAGE.SERVICE, in order to raise the FT
transaction

TEMENOS Training Publications Page 7 of 15


T3TCM
Multithreaded Routines– Workshop Solutions

Step 11
Check the F.OFS.RESPONSE.QUEUE to view the FT Transaction ID created as a result of starting
the OFS.MESSAGE.SERVICE. Open the FT to view its contents.

TEMENOS Training Publications Page 8 of 15


T3TCM
Multithreaded Routines– Workshop Solutions

Step 12

View the FT message in T24

Workshop 2
This workshop is based on the common variable CONTROL.LIST. There are 2 work files
F.WORKFILE.1 and F.WORKFILE.2 that are populated with temporary data during the day today
activities of the bank. The contents of this file have to be cleared during the close of business
operations. The job is adhoc. You will have to write a multithreaded routine to clear the contents of
these two files.
(For initial testing you can create a service. After the session on COB you can add this JOB in the
BATCH STAGE A001 and delete the TSA.SERVICE record)

TEMENOS Training Publications Page 9 of 15


T3TCM
Multithreaded Routines– Workshop Solutions

Workshop Solution 2
Step 1

Create the files F.WORKFILE.1 AND F.WORKFILE.2. Enter records in them. (Copy from an existing
folder into the these two files)
F.WORKFILE.1 and F.WORKFILE.2

Step 2

Create the Common file – I_CLEAR.WF.COMMON

COM/CLEAR.WF/FN.WF1,
F.WF1,
FN.WF2,
F.WF2,
FN.WF

Write the .LOAD routine – CLEAR.WF.LOAD


SUBROUTINE CLEAR.WF.LOAD
$INSERT I_COMMON
$INSERT I_EQUATE
$INSERT I_CLEAR.WF.COMMON
FN.WF1="F.WORKFILE.1"
F.WF1=""
FN.WF2="F.WORKFILE.2"

TEMENOS Training Publications Page 10 of 15


T3TCM
Multithreaded Routines– Workshop Solutions

F.WF2=""
CALL OPF(FN.WF1,F.WF1)
CALL OPF(FN.WF2,F.WF2)
RETURN
END

Write the .SELECT routine – CLEAR.WF.SELECT


SUBROUTINE CLEAR.WF.SELECT
$INSERT I_COMMON
$INSERT I_EQUATE
$INSERT I_BATCH.FILES
$INSERT I_CLEAR.WF.COMMON
IF NOT(CONTROL.LIST) THEN
CONTROL.LIST="WF1"
CONTROL.LIST<-1>="WF2"
END
CURRENT.VALUE=CONTROL.LIST<1,1>
BEGIN CASE
CASE CURRENT.VALUE = "WF1"
FN.WF=FN.WF1
GOSUB DO.SELECT
CASE CURRENT.VALUE = "WF2"
FN.WF=FN.WF2
GOSUB DO.SELECT
CASE 1
CRT "INVALID SELECT"
END CASE
RETURN

DO.SELECT:
LIST.PARAM = ""
LIST.PARAM<2>=FN.WF
ID.LIST =""
CRT FN.WF
CALL BATCH.BUILD.LIST(LIST.PARAM,ID.LIST)
RETURN
END

TEMENOS Training Publications Page 11 of 15


T3TCM
Multithreaded Routines– Workshop Solutions

Write the record routine – CLEAR.WF


SUBROUTINE CLEAR.WF(WF.ID)
$INSERT I_CLEAR.WF.COMMON

CALL F.DELETE(FN.WF,WF.ID)
RETURN
END

Step 3

Create the FILE.CONTROL entries. ID – WORKFILE.1 and WORKFILE.2

Step 4
Create the PGM.FILE entry. ID – CLEAR.WF

TEMENOS Training Publications Page 12 of 15


T3TCM
Multithreaded Routines– Workshop Solutions

Step 5

Create the BATCH entry. ID – BNK/CLEAR.WF (This screen shot is for running it as a service)

Note: To run this program as part of COB, input a batch stage in the above record

Step 6

Create the TSA.WORKLOAD.PROFILE record. ID- CLEAR.WF


Create the TSA.SERVICE record. ID- BNK/CLEAR.WF (These two records should be created only
while testing this multithreaded routine as a service. You will have to delete these records when you
are executing this routine as a COB job).

Step 7

Start the TSM and the agents in order to execute it as a service.

TEMENOS Training Publications Page 13 of 15


T3TCM
Multithreaded Routines– Workshop Solutions

Step 8

Check the contents of the Work Files

TEMENOS Training Publications Page 14 of 15


T3TCM
Multithreaded Routines– Workshop Solutions

TEMENOS Training Publications Page 15 of 15


T3TCM

You might also like