Cleaning Up Excessive Job Logs On Your IBM i System
September 25, 2013 Hey, Joe
Thanks for the article on managing IBM i spooled files. We often find it useful to examine user job logs to see exactly where a problem is. But lately, we’ve been getting too many spooled files in QEZJOBLOG. We’re getting 17,000 QZSHSH and QP0ZSPWP job logs each day from website jobs. Any ideas on how to make these useless job logs go away?
Preventing A Job Log From Being Generated
My first thought is to see where these jobs are coming from. If you can find the CL program, job scheduler, or submit jobs statement that launches these jobs, you can change their job parameters to prevent them from producing a job log when the job ends normally.
You can change the job’s message logging parameters either on the Submit Job (SBMJOB) command used to start the job or through a Change Job (CHGJOB) command from inside the job, after the job starts. Both commands use the following Message logging (LOG) parameters to prevent job log generation.
To change the message logging parameters on a SBMJOB statement, use this command with these LOG settings:
SBMJOB CMD(Command to execute) LOG(4 0 *NOLIST) LOGCLPGM(*NO)
To change the message logging parameters once the job is running, use this CHGJOB command with these LOG settings:
CHGJOB LOG(4 0 *NOLIST) LOGCLPGM(*NO)
Here’s what each LOG parameter and the Log CL Program Commands (LOGCLPGM) parameter do.
For the majority of cases, these parameters will stop job logs from being produced if no errors have occurred. So if you can set these parameters either from your SBMJOB statement or from a CHGJOB command when the program is running, you should be able to stop those 17,000 daily job logs from being generated.
Deleting Excessive Job Logs On The System
If you can’t stop your program from generating job logs, you can also use the Delete Spooled File (DLTSPLF) commands to mass delete all the spooled files that match the criteria for your 17,000 jobs.
When the QZSHSH and QP0SZPWP jobs are running on my system, I noticed that the QZSHSH job log printouts contain the literal ‘QSZSHSH’ in the user data parameter of the job logs to be deleted. For QP0SZPWP jobs, they usually contain ‘QP0SZPWP’ in the user data field of their spooled file job logs. I configured the following DLTSPLF commands for automatically deleting QSZSHSH and QP0SZPWP job logs on the assumption that the job logs will also have either ‘QSZSHSH’ or ‘QP0SZPWP’ in their user data. You may have to adjust these commands to meet any special circumstances on your system.
For your QZSHSH jobs, you can easily delete all their job logs with the following DLTSPLF command:
DLTSPLF FILE(*SELECT) SELECT(*ALL *OUTQ *ALL QZSHSH)
Using the *SELECT option on this command, these parameters tell the operating system to: 1) delete all files (first *ALL parm in SELECT) in 2) all output queues (*OUTQ) with 3) any form type (second *ALL parm in SELECT) when 4) their user data value is equal to â€˜QZSHSHâ€™. Running this command deleted all the QZSHSH job logs on my system and any other printouts associated with QZSHSH.
Similarly, you can delete all the QP0ZSPWP spooled files on your system by running this command:
DLTSPLF FILE(*SELECT) SELECT(*ALL *OUTQ *ALL QP0ZSPWP)
Like the QZSHSH jobs, telling DLTSPLF to delete all spooled files with QP0ZSPWP in their user data field will delete all the printouts produced by your QP0SZPWP jobs.
If you test and determine that these commands work, you can set up a job in your job scheduler to go out and delete the QZSHSH and QP0ZPWP job logs in your system on a regular basis, say every hour or so. Doing that, you’d be able to keep those spooled file under control and keep the maximum jobs in the system down to a reasonable level.
With this information you should have two techniques to: 1) Prevent QZSHSH and QP0ZSPWP job logs from being generated; and 2) Delete any excessive QZSHSH and QP0ZSPWP job logs on your system that may still be created. The nice thing about these new techniques is that once you understand them, they can be used to prevent or mass delete job logs for almost any job on the system.
Follow Joe Hertvik on His Blog, on Twitter, and on LinkedIn
Check out Joe’s blog at joehertvik.com, where he focuses on computer administration and news (especially IBM i); vendor, marketing, and tech writing news and materials; and whatever else he come across.
Joe Hertvik is the owner of Hertvik Business Services, a service company that provides written marketing content and presentation services for the computer industry, including white papers, case studies, and other marketing material. Email Joe for a free quote for any upcoming projects. He also runs a data center for two companies outside Chicago. Joe is a contributing editor for IT Jungle and has written the Admin Alert column since 2002.