Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 11

ITSS WORKSHOP DOCUMENT

Workshop Name: Programming


Workshop Result Document

Document History:
ITSS WORKSHOP DOCUMENT

Date Author Status Comments


06/05/2020 Sindhu Input Added Scenario 1 and 2
11/05/2020 Sindhu Input Added Scenario 3
ITSS WORKSHOP DOCUMENT

Scope:
This document will help to understand the various functionality of programming workshop with different business
logics in T24.

Workshop Result:

Scenario1:

A single Savedlists file has all the mandatory fields data in order to create 20 customers & also to create their
respective savings account. Write a multi-thread batch job program to read this single savedlists file, then create
these customer & their respective account. The customer id & account id is auto generated.

Case1:

Write a Multithread Batch job program to read a file and create a Customer and the Savings account.

Result:

The Customer records are created with the information provided in the file and Savings Accounts are created for
the Customers.

Observation:

The customer information is extracted from the file and the Accounts are created for the customer with the
Savings account category.

Detail Steps:

Step1: Create a text file with the customer mandatory information in the directory UD/INWARD.

RAJESH1|RAJESH|1000|RAJ |1
SINDHU2|SINDHU|1000|SIND|1
VICKY1|VICKY|1000|VIC|1
FORD1|FORD|1000|FORD|1
----------------------

Step2: Create an I_COMMON file for the multithread Routine.

COM/PT12/FN.PATH,FV.PATH,FN.ACCOUNT,FV.ACCOUNT
COM/PT12/FN.CUSTOMER,FV.CUSTOMER

Step3: Write a Multithread Batch job program to read a file and create a Customer and the Savings account.

Create a LOAD for the Multi thread Routine.

$PACKAGE EB.PT12SINDHU
SUBROUTINE PT12.CUS.AND.SBACCT.CREATION.LOAD
*--------------------------------------------------------------------------
--
$INSERT I_PT12.CUSACC.COMMON
$USING EB.SystemTables
$USING EB.API
$USING ST.Customer
$USING EB.DataAccess
*--------------------------------------------------------------------------
--
ITSS WORKSHOP DOCUMENT

FN.CUSTOMER = "F.CUSTOMER"
FV.CUSTOMER = ""
EB.DataAccess.Opf(FN.CUSTOMER,FV.CUSTOMER)
FN.ACCOUNT = "F.ACCOUNT"
FV.ACCOUNT = ""
Y.SESS.ID = ""
EB.DataAccess.Opf(FN.ACCOUNT,FV.ACCOUNT)
FN.PATH = "./INWARD"
FV.PATH = ""
EB.DataAccess.Opf(FN.PATH,FV.PATH)
Y.SEQ = ""
SEL.CMD = "" ; S.LIST = "" ; S.COUNT ="" ;S.ERR = ""
PATH.ID = "" ; R.PATH = "" ; PATH.ERR = ""
*--------------------------------------------------------------------------
--
RETURN
END

Step4: Create a SELECCT for the Multi thread Routine.

$PACKAGE EB.PT12SINDHU
SUBROUTINE PT12.CUS.AND.SBACCT.CREATION.SELECT
*--------------------------------------------------------------------------
--
$INSERT I_PT12.CUS.ACC.COMMON
$USING EB.SystemTables
$USING EB.API
$USING EB.DataAccess
$USING EB.Service
*--------------------------------------------------------------------------
--
SEL.CMD = "SELECT ": FN.PATH
EB.DataAccess.Readlist(SEL.CMD,S.LIST,"",S.COUNT,S.ERR)
FOR I = 1 TO S.COUNT
PATH.ID = S.LIST<I>
IF PATH.ID THEN
EB.DataAccess.FRead(FN.PATH,PATH.ID,R.PATH,FV.PATH,PATH.ERR)
EB.Service.BatchBuildList("", R.PATH)
END
NEXT I
*--------------------------------------------------------------------------
--
RETURN
END

Step5: Create a PROCESS for the Multi thread Routine.

$PACKAGE EB.PT12SINDHU
SUBROUTINE PT12.CUS.AND.SBACCT.CREATION(R.REC)
*--------------------------------------------------------------------------
--
$INSERT I_PT12.CUS.ACC.COMMON
$USING EB.SystemTables
$USING EB.API
$USING ST.Customer
$USING EB.DataAccess
$USING AC.EntryCreation
*--------------------------------------------------------------------------
--
CUS.MNEMONIC = FIELD(R.REC,'|',1)
CUS.NAME = FIELD(R.REC,'|',2)
CUS.SECTOR = FIELD(R.REC,'|',3)
CUS.SHRT.NAME = FIELD(R.REC,'|',4)
ITSS WORKSHOP DOCUMENT

CUS.LANG.CODE = FIELD(R.REC,'|',5)
R.ARR<ST.Customer.Customer.EbCusMnemonic> = CUS.MNEMONIC
R.ARR<ST.Customer.Customer.EbCusNameOne> = CUS.NAME
R.ARR<ST.Customer.Customer.EbCusSector> = CUS.SECTOR
R.ARR<ST.Customer.Customer.EbCusShortName> = CUS.SHRT.NAME
R.ARR<ST.Customer.Customer.EbCusLanguage> = CUS.LANG.CODE
CUSTOMER.ID = ""
EB.DataAccess.FWrite(FN.CUSTOMER,CUSTOMER.ID,R.ARR)
R.ARR1<AC.AccountOpening.Account.Customer> = CUSTOMER.ID
R.ARR1<AC.AccountOpening.Account.Category> = "6000"
R.ARR1<AC.AccountOpening.Account.Currency> = "USD"
ACCOUNT.ID = ""
EB.DataAccess.FWrite(FN.ACCOUNT,ACCOUNT.ID,R.ARR1)
*--------------------------------------------------------------------------
--
RETURN
END

Step6: Create a PGM.FILE for the routine PT12.CUS.AND.SBACCT.CREATION

PGM.FILE................... PT12.CUS.AND.SBACCT.CREATION
---------------------------------------------------------------------------
-
1 TYPE.............. B
2. 1 GB SCREEN.TITLE Multi thread routine to create a customer
record.
3 ADDITIONAL.INFO...
4. 1 BATCH.JOB...... @BATCH.JOB.CONTROL
5 PRODUCT........... EB
6 SUB.PRODUCT.......
6 SUB.PRODUCT.......

Step7: Create a Batch job for the service.

BATCH.................BNK/PT12.CUS.AND.SBACCT.CREATION.SERVICE
---------------------------------------------------------------------------
--
1 BATCH.STAGE....... B
2 DEFAULT.PRINTER...
3 PROCESS.STATUS....
4 BATCH.ENVIRONMENT. F
5 DEPARTMENT.CODE...
6. 1 JOB.NAME....... @PT12.CUS.AND.SBACCT.CREATION
7. 1. 1 VERIFICATION
8. 1 FREQUENCY...... D
9. 1 NEXT.RUN.DATE..

Step8: Create a TSA.Service for the Batch(the ID of Batch and Service is same)

TSA.SERVICE........... BNK/PT12.CUS.AND.SBACCT.CREATION.SERVICE
------------------------------------------------------------------------------
1. 1 DESCRIPTION.... The service to run the job
2. 1 SERV
3. 1 WORK.PROFILE... TWO
4. 1 SERVER.STATUS..
5 USER.............. SINDHU.1
6 SERVICE.CONTROL...

Step9: Run the service and confirm the result.

Scenario2:
ITSS WORKSHOP DOCUMENT

Write an API that mainly receives start date & end date and then it returns the following as the return- All the
months (2 digit) & its corresponding year (4 digit) in between this two dates- Last calendar day of the
corresponding month year- Last working day of the month corresponding month year

Case1:

Write an API which receives the start date and end date and returns the last calendar day and last working day
between the start date and end date.

Result:

The month and year is returned for the start date and end date.

Observation:

The days difference between the two dates are calculate by using the API Cdd and the forward date based on the
number of days and start date is calculate by the API Cdt.

Detail Steps:

Step1: Write an API which receives the start date and end date and returns the last calendar day and last working
day between the start date and end date.

$PACKAGE EB.PT12SINDHU
SUBROUTINE PT12.STARTANDEND.DATE
*--------------------------------------------------------------------------
--
$USING EB.API
$USING EB.SystemTables
$USING EB.DataAccess
*--------------------------------------------------------------------------
--
INPUT "STARTDATE"
INPUT "ENDDATE"
EB.API.Cdd(00,STARTDATE,ENDDATE,NO.OF.DAYS)
IF NO.OF.DAYS GE 31 THEN
MONTH.COUNT = MOD(NO.OF.DAYS,31)
VAR = STARTDATE
FOR I = 1 TO MONTH.COUNT
EB.API.Cdt(VAR,32,DATE)
EB.API.Awd("",DATE,Y.RET)
IF Y.RET = ‘W’ OR Y.RET = ‘H’ THEN
MONTH = DATE[3,2]
YEAR = DATE[5,4]
MONTH.YEAR = MONTH:YEAR
CRT MONTH.YEAR
END
END
NEXT I
END
*--------------------------------------------------------------------------
--
RETURN
END

Step2: Create a PGM.FILE for the routine above routine.

PGM.FILE................... PT12.STARTANDEND.DATE
---------------------------------------------------------------------------
-
ITSS WORKSHOP DOCUMENT

1 TYPE.............. M
2. 1 GB SCREEN.TITLE API to receive the start and end date .
3 ADDITIONAL.INFO...
4. 1 BATCH.JOB...... @PT12.STARTANDEND.DATE
5 PRODUCT........... EB
6 SUB.PRODUCT.......
6 SUB.PRODUCT.......

Step3: Execute the routine in mainline and verify the result.

Scenario3:

Capture all Teller, Funds Transfer, Payment order transactions done by the customer accounts into a live template,
having Customer as the id for this live
template.

Case1:

Write a routine to update the live template with the teller, Funds Transfer, Payment order transactions done by
the customer accounts.

Result:

The Live template is updated with the customer transaction details.

Observation:

The template is created with the ‘L’ type and the transactions done by the customer are updated to the live
template.

Detail Steps:

Step1: Create a Live Template to update the Customer transaction details

$PACKAGE EB.PT12SINDHU
SUBROUTINE PT12.CUS.TRANS.UPDATE
*--------------------------------------------------------------------------
--
$USING EB.API
$USING EB.SystemTables
$USING EB.Template
*--------------------------------------------------------------------------
--
Table.name = 'PT12.TRANS.UPDATE' ;* Full application name
including product prefix
Table.title = 'PT12 TRANS.UPDATE' ;* Screen title
Table.stereotype = 'L' ;* H, U, L, W or T
Table.product = 'PT12' ;* Must be on EB.PRODUCT
Table.subProduct = '' ;* Must be on EB.SUB.PRODUCT
Table.classification = 'INT' ;* As per FILE.CONTROL
Table.systemClearFile = 'Y' ;* As per FILE.CONTROL
Table.relatedFiles = '' ;* As per FILE.CONTROL
Table.isPostClosingFile = '' ;* As per FILE.CONTROL
Table.equatePrefix = 'ULVT' ;* Use to create
I_F.EB.LOG.PARAMETER
*--------------------------------------------------------------------------
--
Table.idPrefix = '' ;* Used by EB.FORMAT.ID if set
Table.blockedFunctions = '' ;* Space delimeted list of blocked
functions
ITSS WORKSHOP DOCUMENT

Table.trigger = '' ;* Trigger field used for OPERATION style


fields
*--------------------------------------------------------------------------
--
RETURN
END

Step2: Create a Live Template to update the Customer transaction details

$PACKAGE EB.PT12SINDHU
SUBROUTINE PT12.CUS.TRANS.UPDATE.FIELDS
*--------------------------------------------------------------------------
--
$USING EB.API
$USING EB.SystemTables
$USING EB.Template
*--------------------------------------------------------------------------
--
$USING EB.SystemTables
$USING EB.API
$USING EB.Template
*--------------------------------------------------------------------------
--
EB.Template.TableDefineid("@ID", T24_String) ;* Define Table id
*--------------------------------------------------------------------------
--
EB.Template.TableAddfield("XX.LL.DESCRIPTION", EB.Template.T24String,
"", "")
EB.Template.TableAddfield("XX-.ACCOUNT.ID", EB.T24Account, "", "")
EB.Template.TableAddfield("XX.FT.ID", EB.Template.T24String, "", "")
EB.Template.TableAddfield("XX.TT.ID", EB.Template.T24String, "", "")
EB.Template.TableAddfield("-XX.PAYMENT.ORDER.ID",
EB.Template.T24String, "", "")
EB.Template.FieldSetdefault(defaultValue) ;* Assign default value
*--------------------------------------------------------------------------
--
EB.Template.TableSetauditposition() ;* Poputale audit information
*--------------------------------------------------------------------------
--
RETURN
END

Step3: Write a routine to update the Live template with the customer transaction details.

$PACKAGE EB.PT12SINDHU
SUBROUTINE PT12.UPDATE.CUS.TRANSACTION.TO.LIVE.TMP
*--------------------------------------------------------------------------
--
$USING EB.SystemTables
$USING EB.API
$USING ST.Customer
$USING AC.AccountOpening
$USING EB.DataAccess
*--------------------------------------------------------------------------
--
GOSUB OPN.FILE
GOSUB PROCESS.PARA
RETURN
*--------------------------------------------------------------------------
--
OPN.FILE:
FN.CUSTOMER.ACCOUNT = "F.CUSTOMER.ACCOUNT"
ITSS WORKSHOP DOCUMENT

FV.CUSTOMER.ACCOUNT = ""
EB.DataAccess.Opf(FN.CUSTOMER.ACCOUNT,FV.CUSTOMER.ACCOUNT)

FN.ACCOUNT = "F.ACCOUNT"
FV.ACCOUNT = ""
EB.DataAccess.Opf(FN.ACCOUNT,FV.ACCOUNT)

FN.FUNDS.TRANSFER = "F.FUNDS.TRANSFER"
FV.FUNDS.TRANSFER = ""
EB.DataAccess.Opf(FN.FUNDS.TRANSFER,FV.FUNDS.TRANSFER)

FN.TELLER = "F.TELLER"
FV.TELLER = ""
EB.DataAccess.Opf(FN.TELLER, FV.TELLER)

FN.PAYMENT.ORDER = "F.PAYMENT.ORDER"
FV.PAYMENT.ORDER = ""
EB.DataAccess.Opf(FN.PAYMENT.ORDER, FV.PAYMENT.ORDER)

FN.LIVE.TMP="F.PT12.TRANS.UPDATE"
FV.LIVE.TMP=""
EB.DataAccess.Opf(FN.LIVE.TMP,FV.LIVE.TMP)
RETURN
*--------------------------------------------------------------------------
--
PROCESS.PARA:
SEL.CMD = "SELECT ":FN.CUSTOMER.ACCOUNT
EB.DataAccess.Readlist(SEL.CMD,S.LIST,"",S.COUNT,S.ERR)
LOOP
REMOVE CUSTOMER.ID FROM S.LIST SETTING S.POS
WHILE CUSTOMER.ID : S.POS DO

EB.DataAccess.FRead(FN.CUSTOMER.ACCOUNT,CUSTOMER.ID,R.CUSTOMER.ACCOUNT,
FV.CUSTOMER.ACCOUNT,CUSTOMER.ACCOUNT.ERR)
CUS.AC.CNT = DCOUNT(R.CUSTOMER.ACCOUNT,@FM)
FOR I = 1 TO CUS.AC.CNT
ACCOUNT.ID = R.CUSTOMER.ACCOUNT<I>

SEL.CMD = "SELECT " : FN.FUNDS.TRANSFER : :"WITH DEBIT.ACCT.NO


EQ ACCOUNT.ID"
EB.DataAccess.Readlist(SEL.FT,S.FT.LIST,"",S.FT.COUNT,S.FT.ERR)
FT.ID = S.FT.LIST<S.FT.COUNT>

SEL.TT.CMD = "SELECT " : FN.TELLER : :"WITH ACCOUNT.1 EQ


ACCOUNT.ID"

EB.DataAccess.Readlist(SEL.TT.CMD,S.TT.LIST,"",S.TT.COUNT,S.TT.ERR)
TT.ID = S.TT.LIST<S.TT.COUNT>

SEL.PO.CMD = "SELECT " : FN.PAYMENT.ORDER :"WITH DEBIT.ACCOUNT EQ


ACCOUNT.ID"

EB.DataAccess.Readlist(SEL.PO.CMD,S.PO.LIST,"",S.PO.COUNT,S.PO.ERR)
PO.ID = S.PO.LIST<S.PO.COUNT>

ARR1<EB.PT12SINDHU.ULVTTransUpdate.UlvtAccountId> = ACCOUNT.ID
ARR1<EB.PT12SINDHU.ULVTTransUpdate.UlvtFtId> = FT.ID
ARR1<EB.PT12SINDHU.ULVTTransUpdate.UlvtTtId> = TT.ID
ARR1<EB.PT12SINDHU.ULVTTransUpdate.UlvtPaymentOrder> = PO.ID

EB.DataAccess.FWrite(FN.LIVE.TMP,CUSTOMER.ID,ARR1)
NEXT I
REPEAT
*--------------------------------------------------------------------------
--
RETURN
ITSS WORKSHOP DOCUMENT

END

Step4: Create a Component

component EB.PT12SINDHU
# Component Isolation Definition
metamodelVersion 1.6
# -------------------------------------------------

private method pt12TransUpdate (


)
{
jBC: PT12.TRANS.UPDATE
}

private method pt12TransUpdateFields (


)
{
jBC: PT12.TRANS.UPDATE.FIELDS
}

private method pt12UpdateTransactionToLiveTmp (


)
{
jBC: PT12.UPDATE.TRANSACTION.TO.LIVE.TMP
}

public table ULVTTransUpdate{


t24: ULVT.TRANS.UPDATE
fields:{
UlvtDescription = 1
UlvtAccountId = 2
UlvtFtId = 3
UlvtTtId = 4
UlvtPaymentOrder = 5

}
}

Step5: Create a PGM.FILE for the routine above routine.

PGM.FILE................... PT12.UPDATE.CUS.TRANSACTION.TO.LIVE.TMP
---------------------------------------------------------------------------
-
1 TYPE.............. M
2. 1 GB SCREEN.TITLE Routine to update transaction details .
3 ADDITIONAL.INFO...
4. 1 BATCH.JOB...... @PT12.UPDATE.CUS.TRANSACTION.TO.LIVE.TMP
5 PRODUCT........... EB
6 SUB.PRODUCT.......
6 SUB.PRODUCT.......

Step6: Create a Batch for the job to complete the process.

BATCH........... BNK/PT12.UPDATE.LIVE.TMP.SERVICE
-----------------------------------------------------------------------------
1 BATCH.STAGE.......
2 DEFAULT.PRINTER...
3 PROCESS.STATUS....
4 BATCH.ENVIRONMENT. F
5 DEPARTMENT.CODE...
ITSS WORKSHOP DOCUMENT

6.1 JOB.NAME....... @PT12.UPDATE.CUS.TRANSACTION.TO.LIVE.TMP


7. 1. 1 VERIFICATION
8. 1 FREQUENCY...... D
9. 1 NEXT.RUN.DATE..

Step7: Create a TSA.Service for the Batch(the ID of Batch and Service is same)

TSA.SERVICE........... BNK/UPDATE.LIVE.TMP.SERVICE
------------------------------------------------------------------------------
1. 1 DESCRIPTION.... The service to run the job
2. 1 SERV
3. 1 WORK.PROFILE... ONE
4. 1 SERVER.STATUS..
5 USER.............. SINDHU.1
6 SERVICE.CONTROL...

You might also like