The Job Analysis tool submits a never ending batch job to capture
WRKACTJOB information at specified intervals. Options exist such as
sending a message if a job has used more than a specified amount of
CPU percentage during an interval. The JOBANZ tool can assist in
determining which jobs and conditions are causing a slowdown in
system performance.
The TAA Tool CVTWRKACT is used to capture the WRKACTJOB information.
Each time CVTWRKACT is run, a file is updated in a specified library
with the amount of CPU usage, transactions, response time, and
auxiliary I/O. The file contains both the job total values and the
values for the interval.
Optionally, the updated file is copied to a history file to allow
further analysis.
Getting started
---------------
** As a user with *ALLOBJ authority, enter:
EDTAPPVAL APPVAL(TAASECURE/JOBANZ)
And enter a library name where the JOBANZ objects will exist
such as TAAJOBANZ.
It is recommended that a unique library be used because the
data that will exist in the library is probably only needed on
a temporary basis. Since the amount of data can be quite
large, using a unique library will allow you to specify the
library as an OMITLIB on various save commands.
** As a user with *ALLOBJ authority, enter:
CRTJOBANZ
This creates the JOBANZP file and the JOBANZD data area in the
library you specified. The JOBANZP file will contain the
current and interval information about each active job. The
JOBANZD data area will contain the default settings for
various options.
** You may optionally create the JOBHSTP file in the specified
library, which will contain a copy of the records from JOBANZP
for each interval. This file can become quite large, but
allows for a good analysis if problems occur. See the later
section on 'Maintaining the JOBHSTP file'.
As a user with *ALLOBJ authority, enter:
CRTJOBHST
** Enter CHGJOBANZD and prompt with F4 to see the current values
used for for JOBANZ.
A prompt override program accesses the current values and
places them on the command prompt.
-- The message queue identifies where a message will be
sent if one of the thresholds is exceeded. The default
is QSYSOPR in QSYS. You could name a different message
queue and also process the message queue with your own
break handling program. See the later section on
'Threshold message handling'.
*NONE may be specified to bypass sending any message.
The JOBHSTP file could still be used for analysis.
-- Three different threshold values exist for interactive,
batch, and 'other' type jobs for the CPU percentage use
during an interval. The default for each is 5.0% of
the CPU.
WRKACTJOB identifies the type of job that is active.
Interactive jobs are described as INT and would be
compared to the interactive threshold. Batch jobs are
described as BCH and would be compared to the batch
threshold. If the job is not interactive or batch, it
is considered 'other'. 'Other' job types (mostly
system jobs) would be compared to the 'other'
threshold.
-- The interval time identifies how long to wait between
the use of CVTWRKACT. The default is 30 seconds.
-- The Print option is designed for testing and
understanding how the tool operates. *NO is the
default meaning there is no printed output.
If *YES is specified, each CVTWRKACT interval will
cause the data written to the JOBANZP file to be listed
as a separate spooled file. Each active job is shown
along with the current interval CPU % usage and jobs
are flagged if they have exceeded a threshold. A
message would be sent if a message queue was specified.
Make any required changes and press Enter.
** A simple command exists to display or print the JOBANZD
values. Enter:
DSPJOBANZD
** To start the never ending batch job you must be authorized to
the files that were created. See the later section on
'Security'. If you have created the files, you are
authorized. Enter:
SBMJOBANZ
The TAAJOBANZ job begins by determining the library where the
JOBANZ objects exist and extracting the information from the
JOBANZD data area with the options specified. CVTWRKACT is
used to create an outfile of the active jobs. For the first
usage of SBMJOBANZ, the JOBANZP file in the specified library
is cleared and a record is added to the file for each active
job. Because it is not known at that point how long the jobs
have been active, the first use of CVTWRKACT will not cause
any jobs to exceed a threshold.
The job then waits for the interval to expire. CVTWRKACT is
done again.
If the job record does not exist in the JOBANZP file, a record
is added. Since any CPU usage for a new job must have
occurred during the interval, the CPU usage and percent usage
are determined. If a threshold is met and a message queue is
specified, a message would be sent.
If the job already exists in the JOBANZP file, the information
is updated with the amount of CPU usage for the interval and
the CPU % usage. If the percentage usage exceeds the
corresponding job type threshold and a message queue is
specified, a message is sent to the message queue.
After all updates have been done, the JOBANZP file is read
again. If a record has not been updated with the current
time, the job was ended during the interval. These job
records are deleted.
It may be desirable to modify the options during the running
of the TAAJOBANZ job. For this reason, at the end of each
interval, the current information from the JOBANZD description
is accessed and used. Thus you can dynamically change the
interval time, the threshold values, etc. The new values are
not used until the current interval ends.
To end the TAAJOBANZ job, enter:
ENDJOBANZ
** A menu of the JOBANZ commands exist to assist in further use.
GO JOBANZ
The menu provides a simple review of the commands and allows a
simple entry.
Caveat
------
The use of CVTWRKACT and the calculation of values for the interval
is subject to what is reported by the system and rounding errors.
For example, it would not be unusual to see a job using more than
100% of the CPU.
The intent of the tool is to allow you to find instances where
performance is 'out of bounds' and not necessarily to determine exact
CPU usage and response time.
Commands provided
-----------------
CRTJOBANZ Creates the JOBANZP file and JOBANZD data area
CRTJOBHST Creates the JOBHSTP file
DLTJOBANZ Deletes the JOBANZP file and JOBANZD data area
DLTJOBHST Deletes the JOBHSTP file
SBMJOBANZ Submits the TAAJOBANZ job
ENDJOBANZ Ends the TAAJOBANZ job submitted by SBMJOBANZ
DSPJOBHST Displays the JOBHSTP file
MTNJOBHST Maintains the JOBHSTP file
CHGJOBANZD Changes the values for the JOBANZD data area
DSPJOBANZD Displays or prints the JOBANZD values
Ending the TAAJOBANZ job
------------------------
A special command ENDJOBANZ may be used to end the TAAJOBANZ job
submitted by SBMJOBANZ. You must have *JOBCTL special authority to
use ENDJOBANZ.
ENDJOBANZ uses OPTION(*CNTRLD). The TAAJOBANZ job checks for a
request to end the job at the end of each interval (after any
messages have been sent).
The DELAY time parameter for ENDJOBANZ should be set slightly larger
than the interval time you are using to allow the job to end
normally. For this reason the default is *DFT which accesses the
JOBANZD value for the time interval and adds 5 seconds.
You may also end TAAJOBANZ with ENDJOB or as an option from a display
such as WRKACTJOB.
Note that if a job ends during an interval it is no longer active
when CVTWRKACT is run and will not appear in the interval
information.
Starting and ending the JOBANZ functions multiple times
-------------------------------------------------------
You may include the JOBANZ job as a startup function at IPL or may
start it manually with the SBMJOBANZ command. Only one TAAJOBINZ job
may be active at a time.
You may end the job and restart it as often as needed. Each time the
job is started with SBMJOBANZ, the JOBANZP file is cleared first and
records are added for the active jobs that exist.
Security
--------
Only an *ALLOBJ user can use CRTJOBANZ, CRTJOBHST, DLTJOBANZ, or
DLTJOBHST. When the files are created, they are specified as *PUBLIC
*EXCLUDE. The JOBANZD data area is set to *PUBLIC(*USE).
To run SBMJOBANZ, the user must be authorize to the JOBANZP file for:
*OBJMGT *CHANGE
If the JOBHSTP file exists, the user of SBMJOBANZ must also have
authorization to JOBHSTP for:
*OBJOPR *ADD
To use MTNJOBHST, the user must be authorized to JOBHSTP for:
*OBJMGT *CHANGE
To use CHGJOBANZD, the user must have *CHANGE authority to the
JOBANZD data area.
To use ENDJOBANZ, the user must have *JOBCTL special authority.
DSPJOBANZD allows *PUBLIC usage.
DSPJOBHST requires *USE authority to the JOBHSTP file.
Threshold message handling
--------------------------
If a job exceeds the corresponding job type threshold value and a
message queue is specified in the JOBANZD data area, the TAA3011
message from message file TAAMSGF in TAATOOL is sent.
The default is QSYSOPR in QSYS. You can send the message to any
message queue including one that is read by a break handling program.
To achieve this, do the following:
** Assume your message queue is ABC in LIB1. You would specify
these values on CHGJOBANZD.
** Assume your break handling program name is PGM1 in LIB1.
** You would set the message queue as follows:
CHGMSGQ MSGQ(LIB1/ABC) DLVRY(*BREAK)
PGM(LIB1/PGM1)
** The TAA3011 message sent for a threshold exception has a
message data area layout as:
1 - 10 Job name
11 - 20 User name
21 - 26 Job number
27 - 33 CPU Percent used
** Your program would be coded as follows:
PGM PARM(&MSGQ &LIB &MSGREF)
DCL &MSGQ *CHAR LEN(10)
DCL &LIB *CHAR LEN(10)
DCL &MSGREF *CHAR LEN(4)
DCL &MSGDTA *CHAR LEN(100)
DCL &MSGID *CHAR LEN(7)
DCL &JOB *CHAR LEN(10)
DCL &USER *CHAR LEN(10)
DCL &JOBNBR *CHAR LEN(6)
DCL &CPUPCT *CHAR LEN(7)
DCL &JOBANZLIB *CHAR LEN(10)
DCL &THRTYP *CHAR LEN(10)
LOOP: RCVMSG MSGQ(&LIB/&MSGQ) MSGKEY(&MSGREF) +
MSGDTA(&MSGDTA) MSGID(&MSGID) RMV(*NO)
IF (&MSGID *NE 'TAA3011') DO /* Diff msg ID */
/* */
/* Your processing of diff msg ID */
/* */
GOTO LOOP
ENDDO /* Diff msg ID */
/* TAA3011 message */
CHGVAR &JOB %SST(&MSGDTA 1 10)
CHGVAR &USER %SST(&MSGDTA 11 10)
CHGVAR &JOBNBR %SST(&MSGDTA 21 6)
CHGVAR &CPUPCT %SST(&MSGDTA 27 7)
CHGVAR &JOBANZLIB %SST(&MSGDTA 34 10)
CHGVAR &THRTYP %SST(&MSGDTA 44 10)
/* */
/* Your processing of TAA3011 */
/* */
RCVMSG MSGQ(&LIB/&MSGQ) MSGKEY(&MSGREF) RMV(*YES)
GOTO LOOP
ENDPGM
Maintaining the JOBHSTP file
----------------------------
The JOBHSTP file is optional. Each time the interval records have
been updated to the JOBANZP file, a copy of the records is added to
the JOBHSTP file. JOBHSTP has the same format as JOBANZP, but is an
arrival sequence file.
For example, if you use JOBANZ with an interval of 30 seconds for 12
hours and have an average of 300 jobs active, there would be 432,000
records per day. The record length is approximately 140 bytes or 60
million bytes.
You can perform analysis of the file such as with the DSPJOBHST
command or write your own query. See the section on 'Analyzing the
JOBHSTP file'.
Because the JOBHSTP file can accumulate a large number of records,
you need to have a maintenance strategy.
For example, you may want to keep only the last 3 days of records on
the system. This could be done by entering:
MTNJOBHST RTNDAYS(3)
Any records prior to 3 days from today would be retained. The
current days records cannot be removed. If you want to minimize the
space for a function such as backup, use CLRPFM.
During the running of MTNJOBHST, a work file (JOBHSTP2) is created in
the specified library and all records are copied from JOBHSTP to
JOBHSTP2. The retention date is calculated and all records created
on or after the date are copied back to JOBHSTP. The JOBHSTP2 file
is then deleted.
MTNJOBHST may be run at the same time that the TAAJOBANZ job is
active. Each function attempts to allocate the file for *SHRNUP and
loops for 5 minutes if the lock is not available. For best use of
MTNJOBHST, run when the TAAJOBANZ job is not running or at a low
activity time.
If an error occurs during processing, you must make a manual
recovery.
Analyzing the JOBHSTP file
--------------------------
There is one record for each job that was active for each interval.
The model file used is TAAJOEAP in TAATOOL. The format name is
JOBANZR. The same file layout is used for both the JOBANZP file and
the JOBHSTP file.
To see the field descriptions, use
DSPFMT TAAJOEAP
Each record contains both the total (accumulated for the job thus
far) and the interval value for:
- CPU used
- Interactive transactions
- Response time
- Temporary storage
- Auxiliary I/O
- Interval average response time
Also included is the average response time for the interval.
The DSPJOBHST command provides basic analysis. It will allow
selection and sequencing on various fields. Only the interval values
are shown. A typical command would be:
DSPJOBHST JOB(xxx) SEQ(*QLFJOB)
Only a specific job name would be selected. If you have multiple
jobs of the same name, the output would be sequenced in date/time
within qualified job name.
JOBANZ escape messages you can monitor for
------------------------------------------
None. Escape messages from based on functions will be re-sent.
CRTJOBANZ Command parameters *CMD
----------------------------
None.
CRTJOBHST Command parameters *CMD
----------------------------
None.
DLTJOBANZ Command parameters *CMD
----------------------------
None.
DLTJOBHST Command parameters *CMD
----------------------------
None.
SBMJOBANZ Command parameters *CMD
----------------------------
JOBQ The qualified name of the job queue to be used. The
default is QSYSNOMAX which exists in QSYS.
*LIBL, *CURLIB, or a specific library may be named
for the library.
MTNJOBHST Command parameters *CMD
----------------------------
RTNDAYS The number of days prior to today to retain in the
file. The default is 3 meaning that the records for
the current day and 3 days prior would be retained.
DSPJOBHST Command parameters *CMD
----------------------------
JOB The job name to select on by an *EQ comparison. The
default is *NONE.
USER The user name to select on by an *EQ comparison.
The default is *NONE.
JOBNBR The job number to select on by an *EQ comparison.
The default is *NONE.
FROMDATE The From date to select on by a *GE comparison. The
default is *NONE.
FROMTIME The From time to select on by a '*GE comparison.
The default is *NONE.
TODATE The To date to select on by a *LE comparison. The
default is *NONE.
TOTIME The To time to select on by a *LE comparison. The
default is *NONE.
INTCPU The interval CPU time to select on by a *GE
comparison. The default is *NONE.
INTPCTCPU The interval CPU percent to select on by a *GE
comparison. The default is *NONE.
INTTRANS The interval transactions to select on by a *GE
comparison. The default is *NONE.
INTAVGRSP The interval average response to select on by a *GE
comparison. The default is *NONE.
INTTMPSTG The interval temporary storage to select on by a *GE
comparison. The default is *NONE.
INTAUXIO The interval auxiliary I/O to select on by a *GE
comparison. The default is *NONE.
SEQ How to sequence the output. The default is *NONE
meaning the sequence the file is in which is based
on the convert date/time and the order in which the
CVTWRKACT command converted the jobs.
*QLFJOB may be specified to sequence the information
in ascending order by the qualified job name.
*CPUPCT may be specified to sequence the information
in descending order by CPU percentage used.
*TMPSTG may be specified to sequence the information
in descending order by temporary storage used.
*AUXIO may be specified to sequence the information
in descending order by auxiliary I/O used.
OUTPUT How to output the results. * is the default to
display the spooled file if the command is entered
interactively. The spooled file is deleted after it
is displayed.
If the command is entered in batch or *PRINT is
specified, the spooled file is output and retained.
CHGJOBANZD Command parameters *CMD
-----------------------------
MSGQ The qualified name of the message queue to be sent a
message to if a job exceeds the CPU% during an
interval. If a message queue is named, it must
exist and a specific library must be entered.
The default is QSYSOPR in QSYS.
*NONE may be specified in which case no message
would be sent if a job exceeded a threshold. The
optional JOBHSTP file could still be used for
analysis.
INTTHR The interactive job threshold limit. If the limit
is reached during an interval for an interactive job
and a message queue is defined, a message will be
sent.
The default is 5.0 meaning 5% of the CPU during the
interval.
BCHTHR The batch job threshold limit. If the limit is
reached during an interval for a batch job and a
message queue is defined, a message will be sent.
The default is 5.0 meaning 5% of the CPU during the
interval.
OTHTHR The 'other' job threshold limit. An 'other' job is
one which is not an interactive or batch job. Most
system jobs are in the 'other' category. If the
limit is reached during an interval for a job which
does not meet the criteria for an interactive or
batch job and a message queue is defined, a message
will be sent.
The default is 5.0 meaning 5% of CPU during the
interval.
INTERVAL The number of seconds the TAAJOBANZ job will wait
before using CVTWRKACT again and checking for jobs
exceeding the specified thresholds.
PRINT A *NO/*YES value for whether the contents of the
JOBANZP file will be listed or not.
*NO is the default.
*YES may be specified to causes a listing in which
case there will be one line of data for each active
job. The intent of *YES is to allow an education
and testing function for JOBANZ.
DSPJOBANZD Command parameters *CMD
-----------------------------
OUTPUT How to output the results. * is the default to
display the spooled file if the command is entered
interactively. The spooled file is deleted after it
is displayed.
If the command is entered in batch or *PRINT is
specified, the spooled file is output and retained.
ENDJOBANZ Command parameters *CMD
----------------------------
DELAY The time to delay for OPTION(*CNTRLD) when ending
the TAAJOBANZ job.
The default is *DFT which adds 5 seconds to the
number of seconds specified for the interval. This
allows the job to end normally.
A number of seconds may also be specified.
Restrictions
------------
None.
Prerequisites
-------------
The following TAA Tools must be on your system:
ADDDAT Add date
EDTVAR Edit variable
CHKALLOBJ Check *ALLOBJ special authority
CLCTIMDIF Calculate time differences
CVTDAT Convert date
CVTTIM Convert time
CVTWRKACT Convert WRKACTJOB
DLYJOBLOOP Delay job loop
DUPTAADBF Duplicate TAA data base file
EDTVAR Edit variable
FMTLIN Format line
RSNLSTMSG Resend last message
RTVAPPVAL Retrieve application value
RTVJOBSTS Retrieve job status
RTVSYSVAL3 Retrieve system value 3
SNDCOMPMSG Send completion message
SNDESCINF Send escape information
SNDESCMSG Send escape message
SNDDIAGMSG Send diagnostic message
Implementation
--------------
None, the tool is ready to use.
Objects used by the tool
------------------------
Object Type Attribute Src member Src file
------ ---- --------- ---------- ----------
CRTJOBANZ *CMD TAAJOEA QATTCMD
DLTJOBANZ *CMD TAAJOEA2 QATTCMD
CRTJOBHST *CMD TAAJOEA3 QATTCMD
DLTJOBHST *CMD TAAJOEA4 QATTCMD
SBMJOBANZ *CMD TAAJOEA5 QATTCMD
MTNJOBHST *CMD TAAJOEA6 QATTCMD
CHGJOBANZD *CMD TAAJOEA7 QATTCMD
ENDJOBANZ *CMD TAAJOEA9 QATTCMD
DSPJOBHST *CMD TAAJOEA10 QATTCMD
TAAJOEAC *PGM CLP TAAJOEAC QATTCL
TAAJOEAC2 *PGM CLP TAAJOEAC2 QATTCL
TAAJOEAC3 *PGM CLP TAAJOEAC3 QATTCL
TAAJOEAC4 *PGM CLP TAAJOEAC4 QATTCL
TAAJOEAC5 *PGM CLP TAAJOEAC5 QATTCL
TAAJOEAC6 *PGM CLP TAAJOEAC6 QATTCL
TAAJOEAC7 *PGM CLP TAAJOEAC7 QATTCL
TAAJOEAC8 *PGM CLP TAAJOEAC8 QATTCL
TAAJOEAC9 *PGM CLP TAAJOEAC9 QATTCL
TAAJOEAC10 *PGM CLP TAAJOEAC10 QATTCL
TAAJOEAC24 *PGM CLP TAAJOEAC24 QATTCL
TAAJOEAC25 *PGM CLP TAAJOEAC25 QATTCL
TAAJOEAC26 *PGM CLP TAAJOEAC26 QATTCL
TAAJOEAC27 *PGM CLP TAAJOEAC27 QATTCL
TAAJOEAC28 *PGM CLP TAAJOEAC28 QATTCL
TAAJOEAC29 *PGM CLP TAAJOEAC29 QATTCL
TAAJOEAR10 *PGM RPG TAAJOEAR10 QATTRPG
TAAJOEAR25 *PGM RPG TAAJOEAR25 QATTRPG
TAAJOEAR28 *PGM RPG TAAJOEAR28 QATTRPG
TAAJOEAD *FILE DSPF TAAJOEAD QATTDDS
TAAJOEAE *FILE DSPF TAAJOEAE QATTDDS
TAAJOEAP *FILE PF TAAJOEAP QATTDDS
TAAJOEAQ *FILE PF TAAJOEAQ QATTDDS
JOBANZ *MENU
Structure
---------
TAAJOEAC27 is called by many programs to determine the library
containing the files. The program adopts the authorization of
QSECOFR to access the JOBANZ Application Value in TAASECURE.
CRTJOBANZ Cmd
TAAJOEAC
DLTJOBANZ Cmd
TAAJOEAC2
CRTJOBHST Cmd
TAAJOEAC3
DLTJOBHST Cmd
TAAJOEAC4
SBMJOBANZ Cmd
TAAJOEAC5 CL pgm - Submits TAAJOEAC25
TAAJOEAC25 CL Pgm - Main batch program
TAAJOEAR25 RPG Pgm
TAAJOEAC26 CL Pgm - Calculates time interval
TAAJOEAC28 CL Pgm - Sends msg to MSGQ
TAAHSTEC9 CL Pgm
ENDJOBANZ Cmd
TAAJOEAC9 CL Pgm
MTNJOBHST Cmd
TAAJOEAC6 CL Pgm
DSPJOBHST Cmd
TAAJOEAC10 CL Pgm
TAAJOEAR10 RPG Pgm
CHGJOBANZD Cmd
TAAJOEAC7 CL Pgm
TAAJOEAC29 CL Pgm Prompt override
DSPJOBANZD Cmd
TAAJOEAC7 CL Pgm
TAAJOEAC8 RPG Pgm for printing
JOBANZ Menu
TAAJOEAC24 CL Pgm
TAAJOEAE Display file
|