A Better Way To Read a Job Log
September 28, 2011 Ted Holt
Note: The code accompanying this article is available for download here. A job log is a wonderful thing to have when you’re trying to figure out why a good program went bad. The problem with job logs is that the few messages that point out what went wrong are entombed within myriad irrelevant messages. And job logs can be long. Just recently I dealt with one that was over 400 pages. I wrote a utility to help me make sense of job logs. Maybe it will help you, too. My utility, which I call Convert Job Log (CVTJOBLOG), reads a spooled job log report and writes the information into a database file, which I can query. Querying a database file means that I can use record-selection to drop irrelevant messages, which greatly reduces the number of messages I have to work through. CVTJOBLOG consists of four objects:
I could have added a fifth object–a panel group for help text–but I didn’t need it and I had too many other things to work on. The CVTJOBLOG command has two parameters: a qualified job name, and a qualified database file name. The qualified job name identifies the job you want to study. There must be a spooled job log in the job’s output; CVTJOBLOG will not create a spooled job log. If there is more than one job log in the job, CVTJOBLOG will read the last one. The qualified file name indicates the database file member to contain the job log information. I often place this file in QTEMP. If the member exists, it will be cleared. If the file and/or member do not exist, they will be created as required. I recommend that you not use the template file, JOBLOGDATA. It’s OK to use a file of that name in another library, but I don’t use the template itself. Here’s an example: CVTJOBLOG JOB(744460/SOMEBODY/SOMEJOB) FILE(QTEMP/JL) The last job log in job 744460/SOMEBODY/SOMEJOB is read and loaded into a file called JL in QTEMP. I did not specify a member name because the name of the member is not important. I hope you’ll find this utility beneficial when you’re faced with a long job log. Let me know.
|