The Time Record tool is a series of commands that allow capturing of
time in seconds and 6 digits of sub seconds by using SNDTIMRCD at
various points in an application. A journal entry is written. The
CVTTIMRCD command may then be used to extract the entries to a data
base file.
The DSPTIMRCD command allows you to analyze the entries with the
calculated difference in time. TIMRCD is designed to assist in
understanding performance tradeoffs, but may also be used to provide
an audit trail.
Creating the TIMRCD Journal
---------------------------
To begin, you have to create the TIMRCD journal or use an existing
journal. To keep the entries separate, a separate journal is
suggested and it should be placed where all applications can access
it such as in QGPL.
You can create the TIMRCD journal with CRTTIMRCDJ:
CRTTIMRCDJ LIB(QGPL)
CRTTIMRCDJ will create the journal TIMRCD and the journal receiver
TIM000001.
Example of TIMRCD
-----------------
Assume you want to know the impact of coding a sub function in
various ways. You could place the SNDTIMRCD command before and after
the call to the sub function. Then run the main program which causes
journal entries to be written. After reworking the sub function, run
the main program again.
Then run CVTTIMRCD which will convert the entries written by
SNDTIMRCD to the data base file TIMRCDP.
DSPTIMRCD may then be used to display the time difference between the
entries. Time is shown in seconds to 6 decimal places.
TIMRCD Journal
--------------
The TIMRCD journal must be created and is the default used on
SNDTIMRCD and CVTTIMRCD. If CRTTIMRCDJ is used, the TIMRCD journal
is specified as MNGRCV(*SYSTEM) and DLTRCV(*YES) to minimize any
actions required on the journal receivers.
The authority is set to allow the *PUBLIC user to use SNDTIMRCD and
CVTTIMRCD. This allows any programmer to use the TIMRCD function.
You should not journal any files to the TIMRCD journal because you
would be allowing any user to display the entries.
You may specify another journal in place of TIMRCD, but the following
authorizations are needed:
** SNDTIMRCD requires *OBJOPR and *ADD.
** CVTTIMRCD requires *OBJOPR, *READ, *OBJEXIST, and *EXECUTE.
The SNDTIMRCD command sends a journal code of 'U' with an entry type
of 'TT'.
Time Group and Description
--------------------------
The SNDTIMRCD command allows you to identify a 'Time Group' and a
description. The 'Time Group' allows a common identification of the
records you want to analyze. The 'Time Group' field defaults to
*USRPRF meaning the job's user name. The default allows multiple
users to be sending time entries to the same journal at the same time
so they met be grouped properly for comparison. Any name may be
used.
The TEXT parameter allows you to identify the time record so you know
where it occurred. For example:
SNDTIMRCD TEXT('First use')
TIMRCD escape messages you can monitor for
------------------------------------------
None. Escape messages from based on functions will be re-sent.
SNDTIMRCD Command parameters *CMD
----------------------------
TIMGRP The Time Group name to be assigned to the journal
entry. The Time Group name allows a method of
grouping the time records that should be analyzed
together. The default is *USRPRF meaning the name
of the user who is running the job when SNDTIMRCD is
used. A specific Time Group may be used.
TEXT The text description for the entry. The default is
*NONE. Assigning a unique text description allows
you to determine where the time record occurred.
JRN The qualified name of the journal to be used. The
default is TIMRCD in *LIBL. The TIMRCD journal if
created by CRTTIMRCDJ is created with authority to
allow the *PUBLIC user to use SND/CVTTIMRCD.
A different journal may be named, but the user must
be authorized to be able to send a journal entry
(*OBJOPR and *ADD).
CRTTIMRCDJ Command parameters *CMD
-----------------------------
LIB The library where the journal and journal receiver
will exist.
The library should be accessible for all
applications such as QGPL.
CVTTIMRCD Command parameters *CMD
----------------------------
TIMGRP The Time Group that was assigned to the journal
entry that should be converted. The default is
*USRPRF meaning the name of the user who is running
the job when CVTTIMRCD is used. A specific ID may
also be used if depending on the value specified on
SNDTIMRCD.
*ALL may be specified to convert all journal codes
of 'U' and all journal entry types of 'TT'.
FROMTIME A two part parameter to describe the starting
date/time of the journal entries that should be
converted.
The first part is the date which defaults to *TODAY
meaning the current day. A specific date may be
entered in job format.
The second part is the time which defaults to *FIRST
meaning the earliest entry of the date specified. A
specific time may be entered.
TOTIME A two part parameter to describe the ending
date/time of the journal entries that should be
converted.
The first part is the date which defaults to *TODAY
meaning the current day. A specific date may be
entered in job format.
The second part is the time which defaults to *LAST
meaning the last entry on the date specified. A
specific time may be entered.
JRN The qualified name of the journal to be converted
from. The default is TIMRCD in *LIBL. If
CRTTIMRCDJ is used to create the TIMRCD journal it
is created with authority to allow the *PUBLIC user
to use SND/CVTTIMRCD.
A different journal may be named, but the user must
be authorized to convert the journal entries
(*OBJOPR, *READ, and *EXIST).
OUTLIB The library in which the file TIMRCDP will be
placed. The default is *LIBL. If the TIMRCDP file
does not already exist, a library must be named.
OUTMBR The member of the TIMRCDP file to be used. The
default is TIMRCDP. If the member does not exist it
is added.
REPLACE A *YES/*NO value for whether the member should be
cleared before writing records into it. The default
is *YES.
*NO may be specified to add records to any existing
data.
DSPTIMRCD Command parameters *CMD
----------------------------
TIMGRP The name assigned to the Time Group that was
converted by CVTTIMRCD. The default is *USRPRF
meaning the name of the user who is running the job
when DSPTIMRCD is used.
*ALL may be specified to display all records in the
TIMRCDP file. If multiple users were using
SNDTIMRCD to the same journal at the same time, the
time difference results are meaningless.
FROMTIME A two part parameter to describe the starting
date/time of the journal entries that should be
converted.
The first part is the date which defaults to *TODAY
meaning todays date. A specific date may be entered
in job format or the special value *FIRST meaning
the first record in the file
The second part is the time which defaults to *FIRST
meaning the earliest entry of the date specified. A
specific time may be entered.
TOTIME A two part parameter to describe the ending
date/time of the journal entries that should be
converted.
The first part is the date which defaults to *TODAY
meaning todays date. A specific date may be entered
in job format or the special value *FIRST which
means the first record in the file.
The second part is the time which defaults to *LAST
meaning the last entry on the date specified. A
specific time may be entered.
TIMRCDLIB The library where the TIMRCDP file exists. The
default is *LIBL. A specific library or the special
value *CURLIB may be used.
TIMRCDMBR The member of the TIMRCDP file to be used. The
default is *FIRST. A specific member may be 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.
Restrictions
------------
If the number of days between time records to be analyzed exceeds
five days, the difference is not calculated and error text appears
instead of the difference.
Prerequisites
-------------
The following TAA Tools must be on your system:
CLCDATDIF3 Calculate date difference 3
CVTDAT Convert date
CVTTIM Convert time
DUPTAADBF Duplicate TAA data base file
EDTVAR Edit variable
RTVDAT Retrieve date
RTVSYSVAL3 Retrieve system value 3
SNDCOMPMSG Send completion message
SNDESCINF Send escape information
SNDESCMSG Send escape message
SNDSTSMSG Send status message
Implementation
--------------
None, the tool is ready to use.
Objects used by the tool
------------------------
Object Type Attribute Src member Src file
------ ---- --------- ---------- ----------
SNDTIMRCD *CMD TAATINA QATTCMD
CVTTIMRCD *CMD TAATINA2 QATTCMD
DSPTIMRCD *CMD TAATINA3 QATTCMD
CRTTIMRCDJ *CMD TAATINA4 QATTCMD
TAATINAC *PGM CLP TAATINAC QATTCL
TAATINAC2 *PGM CLP TAATINAC2 QATTCL
TAATINAC3 *PGM CLP TAATINAC3 QATTCL
TAATINAC4 *PGM CLP TAATINAC4 QATTCL
TAATINAC13 *PGM CLP TAATINAC13 QATTCL
TAATINAR2 *PGM RPG TAATINAR2 QATTRPG
TAATINAR3 *PGM RPG TAATINAR3 QATTRPG
TAATINAP *FILE PF TAATINAP QATTDDS
TIMRCD *JRN
TIM0000001 *JRNRCV
The TIMRCD journal and associated receiver are not shipped. They are
created by the CRTTIMRCDJ command.
Structure
---------
CRTTIMRCDJ Cmd
TAATINAC4 CL pgm
SNDTIMRCD Cmd
TAATINAC CL pgm
CVTTIMRCD Cmd
TAATINAC2 CL pgm
TAATINAR2 RPG Pgm
DSPTIMRCD Cmd
TAATINAC3 CL pgm
TAATINAR3 RPG Pgm
TAATINAC13 CL pgm
|