Multithreaded Routines
Day 2 - Session 1-4
Administration
Dates
MM/DD/YYYY Technical Courses
Venue
xxxx
Objectives
Objectives
Understanding and performing batch processing
• Processes in T24
• What is a Batch ?
• What is Batch Processing ?
Optimization of batch process.
• Batch Flow
• Batch Stage
3 Thesys Training Centre
Objectives
Customizing using routines
• Multithreaded Routines
• How to Create the Multithreaded routines
– What is Common Variable
– How to write LOAD routine
– How to write SELECT routine
– How to write the PROCESS routine
– How to Write the PGM.FILE entry
– Where to add the routine in a BATCH
4 Thesys Training Centre
Objectives
How to Initiate, Monitor and Control a Batch Process
• JOB.BATCH.CONTROL
5 Thesys Training Centre
Session wise Breakup
Session 1
• Understanding and performing batch processing
• Optimization of batch process
Session 2
• Customizing using routines
Session 3
• How to Initiate, Monitor and Control a Batch Process
Session 4
• Workshop
6 Thesys Training Centre
Understanding and performing batch processing
T24 Process
T24 run in two distinct modes
• ONLINE &
• BATCH
ONLINE
• for entering contracts and maintaining static information
BATCH
• for processing events, calculating interest, and rolling the bank
date forward
8 Thesys Training Centre
What is a BATCH ?
It holds the details of the processes that are to be run in the
T24 batch system.
It allows the user to set up individual process for applications
It defines various control parameters
It decides how the process is to be run i.e foreground or
background
It defines which default printer to be used to print reports
generated.
It decides the jobs (application routines) to be run
9 Thesys Training Centre
What is a BATCH?
It decides the cycling frequency and the next run date for the
jobs
It Maintains the current status of the process and the
individual jobs
It updates the last run date by the Batch Control System.
10 Thesys Training Centre
What is Batch Processing ?
Processing group of activities during COB.
Activities could be
• Application Processing
• Interest Accruals
• Generation of Reports
• Dates Changes etc
11 Thesys Training Centre
What is Batch Processing ?
The Batch control system which is invoked to display the list
of processes to be run.
If a 'company mnemonic' has not been specified then the
process of default company will be loaded.
Otherwise the process of specified company is loaded.
The Batch name should be a meaningful with respect to the
• Application or
• Function
of the process.
12 Thesys Training Centre
Optimization of batch process
Batch Flow
BATCH
• Can have various stages
PROCESS
• A Batch can have many process
JOBS
• Each process can have many jobs
14 Thesys Training Centre
Batch Stage
Batch Stage allows the user to group the processes into five
distinct stage namely,
• Application
• System wide
• Reporting
• Start of Day and
• Online
15 Thesys Training Centre
Batch Stage
Each stage verifies the completion of all the processes in the
previous stage.
If sequence number has been appended to the batch stage,
then the process can be run concurrently within the stage.
If a sequence number (e.g. A009) has been specified then
the process can be run only when all other processes with
sequence numbers lower than this have completed
successfully.
Processes with the same sequence number can be run
concurrently.
16 Thesys Training Centre
Batch Stage
The first character in Batch Stage must be one of the
following:
• A - Application
• S - System Wide
• R - Reporting
• D - Start of Day
• O - Online
– The remaining 3 characters are process
sequence number and it should be numeric.
17 Thesys Training Centre
Batch Stage
Modifications to the sequence number should adhere to the
following guidelines:
• Sequence numbers in the range 000 to 099 should not be
modified.
• Sequence numbers in the range 100 to 899 - only the last two
digits should be modified.
• Sequence numbers 900 - 999 should not be modified.
18 Thesys Training Centre
Batch Stages - Example
Job Name :EB.CYCLE.DATES
Batch Stage : A000
• The first job to get executed as a part of the COB process.
• It will cycle the dates for the online user.
Job Name :B.DATE.CHANGE
Batch Stage :D000
• This will cycle the date for the COB process.
19 Thesys Training Centre
Batch Stages - Example
Job Name :BATCH.DATE.RESET
Batch Stage :O999
• This job changes the next run date.
20 Thesys Training Centre
BATCH – A View
21 Thesys Training Centre
DEFAULT.PRINTER
Specifies the default printer and form name.
PRINTER.NAME allows the user to define a default printer.
Default SYSTEM printer is defined in DE.FORM.TYPE.
22 Thesys Training Centre
PROCESS.STATUS
Indicates the current process status.
• Status values are:
– 0 - Ready
– 1 - Running
– 2 - Completed successfully
– 3 - On hold or in error
This is a NOINPUT field.
23 Thesys Training Centre
Batch Environment
Defines the environment to run the process in
• F – for Foreground
• B – for Background
A foreground process will run directly on the users terminal
A background process will run as a phantom task.
The background facility allows the user to run a number of
processes concurrently.
The background option may only be used for those
processes which are in the reporting stage.
24 Thesys Training Centre
JOB.NAME
The job name should have an entry in the PGM.FILE.
The PGM.FILE defines the commands or application
routines to be executed as the job.
The PGM.FILE record should be defined as type 'B'
25 Thesys Training Centre
VERIFICATION
JOB.NAME can be dependant on other jobs by specifying
valid job name (s) here.
The batch control system verifies all the jobs referenced
here for their completion
The job (s) referenced must have entries in the JOB.NAME.
This ensures that the jobs to be verified are all part of the
same process.
26 Thesys Training Centre
FREQUENCY
Defines the frequency of the job’s next run.
The next run date entered in field NEXT.RUN.DATE for the
job is automatically cycled.
The following frequencies are supported:
• D - Every working day.
• Dnn - Every nn working day.
• W - Weekly every Friday.
• M - Last working day of every month.
27 Thesys Training Centre
FREQUENCY
• Mnn - Every nn or previous working day of each month.
• A - Ad hoc.
• Y - Last working day of the year.
• Ynn - Last working day of the nn'th month.
• Jxxx - Always run with job name xxx.
28 Thesys Training Centre
NEXT.RUN.DATE
Specifies next bank date on which the job is to be run.
If no date is entered then the next run date is automatically
calculated.
For jobs with frequency ‘D’ the NEXT.RUN.DATE is not
taken into account.
Year must be in the range 1950 - 2049
29 Thesys Training Centre
PRINTER.NAME
Allows the user to control at which printer and form type the
output from the specific job is to appear.
It overrides the default process printer specified in field
DEFAULT.PRINTER.
30 Thesys Training Centre
JOB.STATUS
Indicates the current status of the job.
Some common Job status values are:
• 0 - Ready
• 1 - Running
• 2 - Completed successfully
• 3 - On hold or in error
This is a NOINPUT field.
31 Thesys Training Centre
LAST.RUN.DATE
Indicates the date on which the job was last run.
It is updated and maintained by the System
This is a NOINPUT field.
32 Thesys Training Centre
JOB.MESSAGE
Stores the job error message number.
It is updated and maintained by the System
This is a NOINPUT field.
33 Thesys Training Centre
USER
Specifies the user name whose user profile is loaded when
the job is run.
Allows a particular user environment for a job when it is
running as a part of the batch control system.
The actual user profile of the user entered is used.
If no user name is entered then the default profile of the user
OPERATOR is used.
Must be a valid record on the USER file.
34 Thesys Training Centre
Customizing using routines
Multithreading
When more than one process(tSA) can execute a single
process, the process is said to be multi-threaded.
A thread can be an independent executable unit of a
process.
36 Thesys Training Centre
Why Multithreaded Routines
Multi threaded routines get executed as a part of EOD/COB
process.
To execute COB process in T24 effectively.
To reduce the time taken to complete COB.
The performance of the report generation could be improved
Phantom services to Batch services (Single threaded to
Multithreaded)
Multithreading jobs in Globus is possible only when EOD is run in
Desktop mode.
37 Thesys Training Centre
Working Of The Multithreading
Subsystem In T24
BATCH.JOB.CONTROL splits the job into multiple threads
and executing them simultaneously
BATCH.JOB.CONTROL is making the full use of the
processors available.
Create a name for the job
• The name should be the name of the routine.
38 Thesys Training Centre
Working Of The Multithreading
Subsystem In T24
The BATCH.JOB.CONTROL program first looks for a
program called xxx.LOAD. Once found,
executes it and then executes a program by name
xxx.SELECT.
39 Thesys Training Centre
Working Of The Multithreading
Subsystem In T24
I_xxx.COMMON
• This file will hold all initialized variables which will be used by
the jobs.
40 Thesys Training Centre
Creating Common Variable
Create an insert file and define the variables as common
variables
The Insert file has a keyword COM followed by a name
41 Thesys Training Centre
Creating Common Variable
Include this file in all the 3 routines
• LOAD routine
• SELECT routine
• PROCESS or Main routine
The common variables will loose their values only when the
user logs out of the session.
42 Thesys Training Centre
Working Of The Multithreading
Subsystem In T24
xxx.LOAD
• This routine will perform all initializations
• Necessary files will be opened here
43 Thesys Training Centre
Creating a LOAD routine
Common Variable file Inserted
44 Thesys Training Centre
Working Of The Multithreading
Subsystem In T24
xxx.SELECT
• This routine will create file with all the ids which needs to be
processed by this job
xxx.SELECT will selects all the ids from the file.
Selected list of ids from the file will be written to a hashed file
called xxx.LIST
This LIST file will be automatically created by the system
with JOB.LIST.Session as the file name.
The Session Number is the number of the session that
executed the SELECT routine.
45 Thesys Training Centre
Creating a SELECT routine
Common Variable file Inserted
46 Thesys Training Centre
47 Thesys Training Centre
48 Thesys Training Centre
Working Of The Multithreading
Subsystem In T24
xxx
• This routine will be created with batch job name itself with ONE
argument passed
This subroutine will manipulate on the ids available in the
xxx.LIST file.
49 Thesys Training Centre
Creating PROCESS routine
Common Variable file Inserted
50 Thesys Training Centre
Working Of The Multithreading
Subsystem In T24 – PGM Entry
Create an entry in the PGM.FILE for the BATCH.JOB
BATCH.JOB’ in the PGM.FILE describes the nature of the
job whether it is
• a single threaded job or
• a multi threaded job.
For a multithreaded routine BATCH.JOB can have
• ‘NULL’ or
• ‘@BATCH.JOB.CONTROL’.
For a single threaded routine BATCH.JOB should have the
name of the routine prefixed with an ‘@’.
51 Thesys Training Centre
PGM.FILE Entry
52 Thesys Training Centre
Working Of The Multithreading
Subsystem In T24 – BATCH Entry
Create a new BATCH application with all the mandatory
inputs.
Otherwise add the Job to an existing BATCH record at the
relevant stage.
53 Thesys Training Centre
BATCH ENTRY
54 Thesys Training Centre
Execution flow of Multithreaded routines
Load Routine Load Routine Load Routine
Select Routine
FBNK.JOB.LIST.<3>
Process Routine Process Routine Process Routine
55 Thesys Training Centre
Initiate, Monitor and Control batch Process
BATCH.JOB.CONTROL
Key program that controls the multi threading process in
T24.
splits the job into ‘multiple’ threads
executes them simultaneously
and thus makes optimum use of the available processors
57 Thesys Training Centre
BATCH.JOB.CONTROL
The BATCH.JOB.CONTROL first executes xxx.LOAD.
Then it executes a program by name xxx.SELECT.
Here all ids to be processed are selected and written on to a
file by name xxx.LIST.
Then BATCH.JOB.CONTROL picks up ids from the LIST file
and supplies it to xxx (Main routine).
58 Thesys Training Centre
BATCH.JOB.CONTROL
Main routine will performs the required processes on the id.
Copies of Main routine will be running simultaneously on the
available processors
The BATCH.JOB.CONTROL dynamically decides the
number of ids to be supplied to each copy of Main routines
It ensures and controls the repetition in the processing of
the same ID.
59 Thesys Training Centre
Monitoring the Execution of Main routine
during COB
Can be Monitored using
• COMO
• F.JOB.LIST.<Session Number>
60 Thesys Training Centre
COMO
Log files get stored under a directory &COMO&
LIST &COMO& to get a lot of log files
JED &COMO& <Log file Name> to view the contents of the
log file
Log file ID : tSA_<Agent Number>_<Date and time>
If an agent is restarted, there will be 2 log files for that agent
as the log file ID is based on date and time
Log files do not get cleared automatically
61 Thesys Training Centre
Execution of Main routine in COB
62 Thesys Training Centre
Execution of Main routine in COB
63 Thesys Training Centre
Execution of Main routine in COB
64 Thesys Training Centre
Execution of Main routine in COB
65 Thesys Training Centre
Execution of Main routine in COB
66 Thesys Training Centre
F.JOB.LIST.SessionNumber
Lists all the selcted ids
• LIST F.JOB.LIST.<SessionNumber>
Opens the record to verify the records selected by the
processes.
• JED F.JOB.LIST.<SessionNumber> <List Id>
67 Thesys Training Centre
F.JOB.LIST.SessionNumber
To List the Records
Available in the
F.JOB.LIST.3
68 Thesys Training Centre
F.JOB.LIST.SessionNumber
69 Thesys Training Centre
F.JOB.LIST.SessionNumber
To view all the
Records from
F.JOB.LIST.3
70 Thesys Training Centre
F.JOB.LIST.SessionNumber
Press Esc , Type EX
To get the Next Record
Next Record from
F.JOB.LIST.3
Displayed
71 Thesys Training Centre
Batch Environment
72 Thesys Training Centre
WORKSHOP 1
There is a LOCAL.REFERNCE field by name CHG.FLG in
the Account application. This field can hold any one of the
following values - ‘Y’ or ‘N’. If the balance of any savings
account falls below 5000, then this field is to be set to ‘Y’.
This routine needs to be executed everyday. Check if this
local reference field already contains a value ‘Y’, if so, then
no check needs to be done to the balance of the account
and the value should remain as ‘Y’.
73 Thesys Training Centre
All product names and other company names used herein are for identification purposes only and may be
trademarks or registered trademarks of their respective owners. Errors and omissions excepted,
all specifications are subject to change without notice.
© 2009 Thesys Technologies Incorporated. All rights reserved.
FOR MORE INFORMATION
Visit : www.thesys.co.in
email : marketing@thesys.co.in