TechTalk: AS/400 History File?

Typography
  • Smaller Small Medium Big Bigger
  • Default Helvetica Segoe Georgia Times

From: Nancy Edwards To: All

With the S/36, I used to be able to print out the history report and monitor messages and procedures performed on the system. We've recently purchased an AS/400 and I find I cannot retrieve the messages. Is there any way to do this, or are messages not saved anywhere?

From: Ernie Malaga To: Nancy Edwards

The AS/400's equivalent of the S/36's history file is QHST, a *MSGQ object in QSYS that, unfortunately, contains precious little information. However, the AS/400 keeps a history of each job in a much richer fashion in the job's "job log."

The job log is not an object. It acts like a message queue, but you can't access it except via the Display Job Log (DSPJOBLOG) command, while the job is still running. Once the job ends, the job log cannot be accessed anymore. However, you can force the system to print the job log when the job ends by making sure the job has its LOG attribute set to LOG(4 0 *SECLVL) or LOG(4 0 *MSG). The easiest way to get this done is by changing the job description accordingly.

The difference between LOG(4 0 *SECLVL) and LOG(4 0 *MSG) is that *MSG only prints a one-line message describing each command run or each message received as a consequence. *SECLVL, on the other hand, also prints all the second-level text for the messages, resulting in much longer job logs.

To see what I mean, sign on to a display station, execute a few commands (in order to generate some error or completion messages), and then run:

DSPJOBLOG JOB(*) OUTPUT(*)

This shows you the job log as LOG(4 0 *MSG) would have printed it. If you press F10 (Display Detailed Messages), you see the result of LOG(4 0 *SECLVL). By the way, JOB(*) and OUTPUT(*) are the de-fault parameter values, so you can just execute DSPJOBLOG without any parameters. If you change the OUTPUT parameter to *PRINT, the job log listing goes to the printer, of course.

Printed job logs use printer file QPJOBLOG. You can change this printer file's attributes to direct all job log listings to a particular output queue, or to make sure they're automatically held. For instance:

 CHGPRTF FILE(QPJOBLOG) + HOLD(*YES) 

From here on, job log listings will not start printing automatically; they'll be on hold in the output queue. This gives you an opportunity to look at them or copy them to a database file with the Copy Spool File (CPYSPLF) command. Once the listing is in a database file, you can run a custom-written program to read the file, scanning for any messages you want or looking for commands that were requested by the user (all of which show "RQS" in columns 19-21 of the printout).

BLOG COMMENTS POWERED BY DISQUS

LATEST COMMENTS

Support MC Press Online

$

Book Reviews

Resource Center

  •  

  • LANSA Business users want new applications now. Market and regulatory pressures require faster application updates and delivery into production. Your IBM i developers may be approaching retirement, and you see no sure way to fill their positions with experienced developers. In addition, you may be caught between maintaining your existing applications and the uncertainty of moving to something new.

  • The MC Resource Centers bring you the widest selection of white papers, trial software, and on-demand webcasts for you to choose from. >> Review the list of White Papers, Trial Software or On-Demand Webcast at the MC Press Resource Center. >> Add the items to yru Cart and complet he checkout process and submit

  • SB Profound WC 5536Join us for this hour-long webcast that will explore:

  • Fortra IT managers hoping to find new IBM i talent are discovering that the pool of experienced RPG programmers and operators or administrators with intimate knowledge of the operating system and the applications that run on it is small. This begs the question: How will you manage the platform that supports such a big part of your business? This guide offers strategies and software suggestions to help you plan IT staffing and resources and smooth the transition after your AS/400 talent retires. Read on to learn: