Batches and Multithreading

You might also like

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

BATCH AND BATCH PROGRAMMING

BATCH -holds the details of processes that are to be run


decides the jobs(routines)
defines various control parameters

WHAT IS BATCH PROCESSING?


-Processing group of activities during COB(end of the day)
-activities could be Application processing, Interest accruals,Generation of reports
-setting frequency/next run date for the next jobs to run(Batch entry)
-batch control system is invoked to display list of processes to be run

Batch Stage consists of one or more processes. In T24, these COB Processes are defined in an application
called BATCH
Each Process consists of one or more Jobs that perform a specific task.
All jobs within a process are executed in the order they are defined and NEVER simultaneously.
For E.g. Job 2, will never get executed before Job 1 is complete.

Batch Stage Contains a character to denote the Batch Stage and a 3 digit number to denote the sequence
within the stage.
Sequence numbers are in the range 000 - 999. The first Batch stage executed during COB is A000 and the last
is O999.

BATCH>PROCESS>JOB

PROCESS
A record in the BATCH application is called a process.
All processes are prefixed with the bank mnemonic
Processes to be executed during COB must belong to a Batch Stage.
Processes that do not belong to a Batch Stage will be executed as services.

Process Status field holds the status of the Batch record. It can hold the following values
0 specifies that the process is in Ready state
1 specifies that the process is in Running state
2 specifies that the process has Completed successfully
3 specifies that the process has stopped due to some Error
JOBS
job is a part of process
process can have many jobs
Job Name Contains the name of the routine to be executed. All routines defined here will have an entry in
PGM.FILE with TYPE set to ‘B’
Job Status field Holds the status of the individual job (routine) . It can hold the following values
0 specifies that the job is in Ready state
1 specifies that the job is in Running state
2 specifies that the job has Completed successfully
3 specifies that the job has stopped due to some Error

2types
run during cob(batch stage)
during daytime
DIFFERENT STAGES THE BATCH GOES THROUGH -APPLICATION-A100
A-S-R-D-O
(going to be executed in first stage of cob,all individual application processes)
SYSTEM WIDE-S100 (charge,interest calculation,loan schedules)
REPORTING-R100 (important reports/transaction journals/general ledger)
START OF THE DAY-D100 change of date will happen here
ONLINE-O100 no changes will be allowed

BATCH STAGE -each stage verifies the completion of all the processes in the previous stage

ROUTINES PRESENT
LOAD
SELECT
PROCESS/MAIN

2 DISTINCT MODES -ONLINE for entering contracts and static data information
-BATCH for processing lot of events at a time
for ex: changing dates everyday, calculating interest

-COMPANY.NAME->BNK if company mnemonic is not specified then default one is loaded

-Providing BATCH.STAGE if you want any particular job to be run in desired mode(0123-ONLINE, R100 -
REPORTING, A100 APPLICATION)

Frequency specifies the frequency at which the batch job has to be executed. It can have values as follows.
-D specifies that the job will be executed every working day.
-D nn specifies that the job will be executed every nnth working day
-W specifies that the job will be executed on a weekly basis, that is every Friday
-M specifies that the job will be executed on the last working day of every month
-M nn nn represents the offset added to the first day of every month to arrive at Next Run date.
-Y specifies that the job will be executed last working day of the year
-Y nn specifies that the job will be executed the last working day of the nn'th month

*****A specifies that the job will be executed on adhoc basis. You should manually specify a date on which
the job has to be executed.
MULTITHREADING -when one or more process can execute a single
process,the process is said to be multithreaded
Thread -is a independant/executable unit of process

WHY USE MULTITHREADED ROUTINES?


-multithreaded routines get executed as a part of EOD/COB process
-to execute COB process in T24 effectively
-to reduce time taken to complete COB
-performance of report generation could be improved

BATCH PROGRAMMING STEPS:

3 Routines should be written apart from common file

1]common file -used to initialize variables


(I_xx.COMMON) (include it in the routine)

(syntax) -will start with com/name of all the code(subrtn)/variables to initialize,ERR.

-insert the common file in all routines to be used in the jobs

2] DEFINING LOAD ROUTINE(xxx.LOAD)

-will perform all initializations


-all necessary files will be opened here
-give same name as main routine

3]DEFINING SELECT ROUTINE(xxx.SELECT)

-perform the necessary selections on a particular application

4]DEFINING MAIN ROUTINE

-routine which will perform the main processing

TRIGGERING ORDER=> LOAD->SELECT->MAIN

-------------------putty steps---------------

*here we have perfomred a select on customer and account applications*

compile the files-> all 3


CUS.RAUT.LOAD
CUS.RAUT.SELECT
CUS.RAUT.b

create PGM entry


only for main file we have to create
PGM.FILE, I->main rtn name
Type -> B
Title -> rtn name
Batch job->@BATCH.JOB.CONTROL
product->EB

create batch entry


BATCH, I-> BNK/rtn name
batch env->F foreground
Job name->rtn name
Frequency->D Daily

create service (only required when batch stage is not mentioned)


TSA.SERVICE, I-> BNK/rtn name
description ->BNK/rtn
work profile->one
user->inputter
service control->stop

assign agent in workload profile-


TSA.WORKLOAD.PROFILE, I->rtn name
description->anything
agents required->3/any (job will be perfomred by 3 agents)

now upload the workload profile name in TSA.SERVICE

sh tRun START.TSM
sh tRun START.TSM -DEBUG(understand how many agents are running)

run from backend to debug


backend steps:
sh DBTools -u Priya123 -p Priya@123
JQL
JED F.TSA.STATUS 1998
i5
paste rtn name
s (save)
x (come back)
x (come back)
sh tRun tSA.

----------DEBUGGER STEPS-------------
Source changed to /data/temenos/env/r19/bnk/UD/PRIYANKA.BP/BATCH/CUS.RAUT.b
26 : DEBUG
TAFJ Debugger-> S

29 : Y.ID =Y.LIST
TAFJ Debugger-> S
34 : CALL F.READ(FN.CUSTOMER,Y.ID,R.CUS,F.CUSTOMER,ERR.CUS)
TAFJ Debugger-> S

35 : IF R.CUS THEN
TAFJ Debugger-> S

37 : Y.NAME = R.CUS<EB.CUS.NAME.1>
TAFJ Debugger-> S

38 : Y.MNE = R.CUS<EB.CUS.MNEMONIC>
TAFJ Debugger-> S

39 : Y.SECTOR = R.CUS<EB.CUS.SECTOR>
TAFJ Debugger-> V Y.NAME
Y.NAME : (-1) PRASHANT
TAFJ Debugger-> V Y.MNE
Y.MNE : (-1) AKHAOSE
TAFJ Debugger-> S

40 : Y.ACC.OFF = R.CUS< EB.CUS.ACCOUNT.OFFICER>


TAFJ Debugger-> V Y.SECTOR
Y.SECTOR : (-1) 1001
TAFJ Debugger-> S

41 : Y.GENDER = R.CUS<EB.CUS.GENDER>
TAFJ Debugger-> S

42 : IF Y.ARRAY EQ '' THEN


TAFJ Debugger-> S

43 : Y.ARRAY<-1> = Y.NAME:"*":Y.MNE:"*":Y.SECTOR:"*":Y.ACC.OFF:"*":Y.GENDER
TAFJ Debugger-> S

44 : END
TAFJ Debugger-> S

45 : IF Y.ARRAY THEN
TAFJ Debugger-> S

46 : Y.FILE = "CUS.REPORT.csv"
TAFJ Debugger-> V Y.GENDER
Y.GENDER : (-1) MALE
TAFJ Debugger-> S

48 : CALL F.READ(FN.PATH,Y.FILE,R.FINAL,F.PATH,ERR)
TAFJ Debugger-> S

49 : R.FINAL<-1>= Y.ARRAY<-1>
TAFJ Debugger-> S
50 : CALL F.WRITE(FN.PATH,Y.FILE,R.FINAL)
TAFJ Debugger-> S

51 : END
TAFJ Debugger-> S

52 : END
TAFJ Debugger-> V Y.ARR
Y.ARR : N/A
TAFJ Debugger-> V R.FINAL
R.FINAL : (-1)
TAFJ Debugger-> V Y.ARRAY
Y.ARRAY : (-1) PRASHANT*AKHAOSE*1001*1*MALE
TAFJ Debugger-> V Y.FINAL
Y.FINAL : N/A
TAFJ Debugger-> V R.FINAL
R.FINAL : (-1)
TAFJ Debugger-> S

55 : RETURN
TAFJ Debugger-> S

You might also like