The history log (QHST) consists of a message queue and a physical file known as a log-version.
Messages sent to the history log message queue (QHST) are written by the system to the current log version physical file. The history log contains a high-level trace of system activities such as system, subsystem, and job information, device status, and system operator messages.
When a log-version is full, a new version of the log is automatically created. Each version is a physical file that is named in the following way:
Qxxxyydddn
where the following is true:
The text of the log version file contains the date and time of the first message and last message in the log version. The date and time of the first message are in positions 1-13 of the text; the date and time of the last message are in positions 14-26. The date and time are in the format cyymmddhhmmss, where:
You can create a maximum of 36 log versions with the same Julian date. If more than 36 log versions are created on the same day, the next available Julian day is used for subsequent log versions. If some of the older log versions are then deleted, it is possible to use the names again. Log versions are out of order when sequenced by name if log versions are deleted and names used again.
You can also write a program to process history log records. Because several versions of each log may be available, you must select the log-version to be processed. To determine the available log-versions, use the Display Object Description (DSPOBJD) command. For example, the following Display Log (DSPLOG) command displays what versions of the history log are available:
DSPOBJD OBJ(QSYS/QHST*) OBJTYPE(*FILE)
You can delete logs on your system by using the delete option from the display that is presented on the Work with Objects (WRKOBJ) command.
You can display or print the information in a log using the Display Log (DSPLOG) command. You can select the information you want displayed or printed by specifying any combination of the following:
The following Display Log (DSPLOG) command displays all the available entries for the job OEDAILY in the current day:
DSPLOG JOB(OEDAILY)
The resulting display is:
Display History Log Contents Job OEDAILY started Database file OEMSTR in library OELIB expired Job OEDAILY abnormally ended Job OEDAILY started Job OEDAILY ended Bottom Press Enter to continue. F3=Exit F10=Display all F12=Cancel
If you reset the system date or time to an earlier setting, or if you advanced the system date and time by more than 48 hours, a new log version is started. This ensures that all messages in a single log version are in chronological order.
Log versions created on a release prior to V3R6M0 may contain entries that are not in chronological order if the system date and time was reset to an earlier setting. Therefore, when you try to display the log-version, some entries may be missed. For example, if the log-version contains entries dated 1988 followed by entries dated 1987, and you want to display those 1987 entries, you specify the 1987 dates on the PERIOD parameter on the Display Log (DSPLOG) command but the expected entries are not displayed. You should always use the system date (QDATE) and the system time (QTIME), or you should specify the PERIOD parameter as follows:
PERIOD((start-time start-date) (*AVAIL *END))
The system writes the messages sent to a log message queue to the current log version physical file when the message queue reaches a certain size or when the Display Log (DSPLOG) command was used. If you want to ensure the current log version is up-to-date, specify a fictitious message identifier, such as ###0000, on the DSPLOG command. No messages are displayed, but the messages in the message queue are copied to the log version physical file to make it current.
If you print the information in a log using the Display Log (DSPLOG) command and output parameter *PRINT, (DSPLOG OUTPUT(*PRINT)), only one line from each message is printed, using the first 105 characters of each message.
If you print the information in a log using the Display Log (DSPLOG) command and output parameter *PRTWRAP, (DSPLOG OUTPUT(*PRTWRAP)), messages longer than 105 characters are wrapped to include additional lines to a limit of 2000 characters.
If you print the information in a log using the Display Log (DSPLOG) command and output parameter *PRTSECLVL, messages longer than 105 characters are wrapped to include additional lines to a limit of 2000 characters. The second-level message text is also printed if available, up to a maximum of 6000 characters.
If you display the information in a log using the Display Log (DSPLOG) command, only 105 characters of message text are shown. Any characters after 105 characters are truncated at the right.