The Convert QHST to a file command converts one or more QHST files to
a normal data base file. You must have *USE authority to the
TAACVTQHST Authorization List.
The system maintains a log named QHST for all important messages
which have occurred. All messages sent to QSYSOPR are automatically
logged to QHST as well as other significant events such as security
violations. A user application can also send a message to QHST.
When the log becomes full (based on the QHSTLOGSIZ system value), a
data base file is automatically created in QSYS. Each file has a
unique name beginning with QHST followed by a 5 digit julian date and
a one character letter (A-Z) to denote separate logs created on the
same day.
The system does not delete the files. You must delete each file when
no longer needed. See the TAA Tool DLTQHST. You can write programs
to analyze the messages in a QHST data base file.
Each QHST file is a series of 142 byte records which is described in
the Message Handling chapter of the CL Programmers Guide. Each
record is distinguished by a binary record count in positions 9-10
which starts with 1 for each message and continues for as many 142
byte records as are required. The first record contains standard
information. The second record contains up to 132 bytes of the
message text (message text greater than 132 bytes is truncated). The
second record may also contain part of the message data. The message
data may overflow onto the following records.
The file is difficult to process with a HLL program. The CVTQHST
command converts the file into an externally described data base file
(QHSTP) which can be more easily processed. QHSTP is created as
SIZE(5000000 10000 10).
The message data field in QHSTP is defined as 264 bytes and the
information varies based on the message ID. If message data exceeds
264 bytes, it is truncated and no error occurs. To process the
message data for a specific message ID, you must be aware of the
format of the message data. The TAA command DSPMSGDTA can be used to
display the format such as:
DSPMSGDTA MSGID(CPF1164)
A typical command would be:
CVTQHST QHSTFILE(QHST05240A) QHSTPLIB(xxx) REPLACE(*NO)
Selection criteria exists for:
JOB All jobs, a generic job , or a specific job.
Defaults to *ALL.
USER All users, a generic name, or a specific user.
Defaults to *ALL.
MSGID All messages or a list of up to 40 specific IDs.
Defaults to *ALL.
FROMDATE The From Date. Only those QHST records in the range
of the From Date/Time and the To Date/Time will be
output. The default is *BEGIN meaning the first
QHST file is considered.
TODATE The To Date. The default is *TODAY meaning that
every record within the range of the From Date/Time
and current date/To Time will be output.
FROMTIME The From Time. Only those QHST records in the range
of the From Date/Time and the To Date/Time will be
output. The default is *BEGIN meaning the first
QHST file is considered.
TOTIME The To Time. The default is *END meaning the last
time on the To date.
If no records are converted, the TAA9894 escape message is sent.
The CVTQHST command adopts the Security Officer profile (See the
Security Considerations section). To use the command you must be
authorized to the TAACVTQHST authorization list (or have *ALLOBJ
authority).
CVTQHST escape messages you can monitor for
-------------------------------------------
TAA9893 From Date cannot be greater than the current date.
TAA9894 No records written to QHSTP. Check selection parms.
Command parameters *CMD
------------------
QHSTFILE The qualified file name to be converted. A name may
be specified, or *ALL (all QHST files), or *LAST
(the last QHST file) The library name defaults to
*LIBL and would normally be used (the QHST files
exist in QSYS). The intent of using a specific
library name allows for simplified testing of
smaller files.
QHSTPLIB The library containing the QHSTP file. *LIBL is the
default. If the file does not exist, a library must
be specified. If a library is specified and the
QHSTP file does not exist, it is created
automatically.
QHSTPMBR The member for the QHSTP file to be use. The
default is *FIRST.
REPLACE A *YES/*NO value which controls whether the QHSTP
file is replaced.
JOB Whether to select records for all jobs, a specific
job, or a generic job name. The default is *ALL to
select all job names.
USER Whether to select records for all users, a specific
user, or a generic user name. The default is *ALL
to select all user names.
MSGID Whether to convert all or a list of specific message
IDs. The default is *ALL for all message IDs.
A list of up to 40 message IDs (such as CPF1164) may
be entered to convert only those message IDs.
FROMDATE The From Date of the QHSTn data to be output. The
default is *BEGIN meaning the first QHST file is
considered.
Only those QHST records in the range of the From
Date/Time and To Date/Time will be output.
*TODAY may be entered for the current date.
If a date (not a special value) is entered, it must
be in job format.
The From Date/Time must be greater than or equal
than the To Date/Time.
The From Date must be equal or less than the the
current date.
TODATE The To Date of the QHSTn data to be output. The
default is *TODAY meaning that every record within
the range of the From Date/Time and the current
date/time will be output.
If a date (not a special value) is entered, it must
be in job format.
FROMTIME The From Time of the QHSTn data to be output. The
default is *BEGIN meaning the beginning time of the
FROMDATE. A time may be entered in HHMMSS format
with our without time separators.
TOTIME The To Time of the QHSTn data to be output. The
default is *END meaning the last time of the TODATE.
A time may be entered in HHMMSS format with our
without time separators.
File format
-----------
The file name that is output is QHSTP.
The model file used is TAAHSTAP with a format name of QHSTR.
To see the field names used:
DSPFMT TAAHSTAP
Security considerations
-----------------------
The command CVTQHST and the TAAHSTAC CL program are created so they
may only be executed by a user who is authorized to the TAACVTQHST
authorization list.
Prerequisites
-------------
The following TAA Tools must be on your system:
CHKOBJ3 Check object 3
DUPFILFMT Duplicate file format
EDTVAR Edit variable
EXTLST2 Extract list 2
CHKGENERC Check generic
RTVDAT Retrieve date
SNDESCMSG Send escape message
SNDCOMPMSG Send completion message
Implementation
--------------
The tool is ready to use, but a user must be authorized to the
TAACVTQHST authorization list. To authorize a user, use EDTAUTL or
specify:
ADDAUTLE AUTL(TAACVTQHST) USER(xxx) AUT(*USE)
Objects used by the tool
------------------------
Object Type Attribute Src member Src file
------ ----- --------- ---------- -----------
CVTQHST *CMD TAAHSTA QATTCMD
TAAHSTAP *FILE PF TAAHSTAP QATTDDS
TAAHSTAC *PGM CLP TAAHSTAC QATTCL
TAAHSTAR *PGM RPG TAAHSTAR QATTRPG
|