Flylib.com

Books Software

 
 
 

- page 32


Job Logs

All jobs have a log in which the system records what the user is doing (the commands entered) and practically all the messages the user sees on the screen for whatever reason. This facility is called the job log.

You can display your own jobs job log using the Display Job Log (DSPJOBLOG) command. You dont need to supply any parameters. The Display Job Log screen gives you an instant history listing of everything you have done since you signed on. This command allows you to go back and examine what you did and reread messages you may have missed. Figure 3.7 shows an example of the Display Job Log panel.

image from book
Figure 3.7: Example of the Display Job Log (DSPJOBLOG) command.

From this panel, press F10 to display all the messages that have been recorded, not just the requests you have entered. Figure 3.8 shows this panel.

image from book
Figure 3.8: Example of detailed messages in the Display Job Log (DSPJOBLOG) command.

You also can display someone elses job log if you have sufficient authority (such as *JOBCTL). Just access the job you are interested in with any of the WRKXXXJOB commands, enter an option 5 to display the job, press Enter , and select the right option from the menu presented. You can do this for any job in the system, whether it is interactive, batch, communications, or spool.

The Display Job Log panel lets you roll back and forth to display a number of messages at a time. These messages cannot be removed. You can display full information by positioning the cursor at the message line and pressing the Help or F1 key. Press F10 to include all detailed messages, F17 to go directly to the beginning of the job log, and F18 to go to the end. F5 updates the job log panel, which includes new messages and entries that may have occurred after you began displaying the job log.

Although you can force the system to print the job log whenever jobs end (whether normally or in error), you probably will not want to, because you would soon have dozens (or hundreds) of printed job logs, some of which can be hundreds of pages long.

Tip 

Job logs are always printed when a job ends abnormally. Forexample, if you submit a job that prints a customer master listing to batch, but the program cannot find the customer master file, the job ends abnormally and the system prints a job log. If you sign on to a display station and the system operator cancels your job; the job will end abnormally, which causes a printed job log.

To control the printing of the job log, use the Change Job (CHGJOB) command to change the log parameters value. A value such as (4 00 *NOLIST) ensures that job logs are printed only if the job ends abnormally. If you always want a job log, set the value to (4 00 *MSG) or (4 00 *SECLVL). The difference between these two values is that *SECLVL also prints the second-level text for every message. *SECLVL provides text that can mean the difference between understanding and not understanding why the job ran into trouble. However, *SECLVL also causes considerably longer job logs. If you dont need that much information, consider using *MSG instead of *SECLVL.

You set the log parameter at the job description level using the Change Job Description (CHGJOBD) command. Job descriptions are described in detail in Chapter 11.



The System Log, QHST

The i5 also provides a system-wide log called QHST. QHST records events in this log, which provides a history of system activity. (The system log gives very little information, because most of that information is recorded in job logs. Both the system log and the job logs are not adequate means to keep track of how much each user utilizes the system. If you are looking for that application, you should check Job Accounting.)

The Display Log (DSPLOG) command displays or prints the system log. You can provide some selection through parameters and, as with job logs, display complete information for the messages recorded in the log by positioning the cursor and pressing Help or F1. The system log panel is shown in Figure 3.9.

image from book
Figure 3.9: Example of the Display History Log Contents (DSPLOG) command.

The system log is a message queue object (*MSGQ); you can write to the system log directly with the Send Message (SNDMSG) command and supply TOMSGQ(QHST). For example:


SNDMSG MSG('Security violation at display station


DSP13.') TOMSGQ(QHST)

QHST has a fixed size . When it fills up, the system automatically creates a copy in a database file and then clears QHST of all contents. These old copies have names that begin with "QHST" plus a few digits. They are not message queues, but files. These files accumulate in your system's QSYS library, and it is your responsibility to delete them periodically.

Operational Assistant (see Chapter 7) can help you keep old system logs under control.