Multithreaded Routines
May 2011
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
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
Objectives
How to Initiate, Monitor and Control a Batch Process
JOB.BATCH.CONTROL
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
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
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
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.
What is Batch Processing ?
Processing group of activities during COB.
Activities could be
Application Processing
Interest Accruals
Generation of Reports
Dates Changes etc
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.
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
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
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.
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.
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.
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.
Batch Stages - Example
Job Name :BATCH.DATE.RESET
Batch Stage:O999
This job changes the next run date.
BATCH – A View
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.
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.
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.
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'
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.
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.
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.
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
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.
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.
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.
JOB.MESSAGE
Stores the job error message number.
It is updated and maintained by the System
This is a NOINPUT field.
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.
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.
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.
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.
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.
Working Of The Multithreading Subsystem In T24
I_xxx.COMMON
This file will hold all initialized variables which will be used by the jobs.
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
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.
Working Of The Multithreading Subsystem In T24
xxx.LOAD
This routine will perform all initializations
Necessary files will be opened here
Creating a LOAD routine
Common Variable file Inserted
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.
Creating a SELECT routine
Common Variable file Inserted
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.
Creating PROCESS routine
Common Variable file Inserted
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 ‘@’.
PGM.FILE Entry
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.
BATCH ENTRY
Execution flow of Multithreaded routines
Load Routine Load Routine Load Routine
Select Routine
FBNK.JOB.LIST.<3>
Process Routine Process Routine Process Routine
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
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).
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.
Monitoring the Execution of Main routine during COB
Can be Monitored using
COMO
F.JOB.LIST.<Session Number>
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
Execution of Main routine in COB
Execution of Main routine in COB
Execution of Main routine in COB
Execution of Main routine in COB
Execution of Main routine in COB
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>
F.JOB.LIST.SessionNumber
To List the Records
Available in the
F.JOB.LIST.3
F.JOB.LIST.SessionNumber
F.JOB.LIST.SessionNumber
To view all the
Records from
F.JOB.LIST.3
F.JOB.LIST.SessionNumber
Press Esc , Type EX
To get the Next Record
Next Record from
F.JOB.LIST.3
Displayed
Batch Environment
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’.
www.capgemini.com/financialservices