There is a feature in IBM i that you can use to set a limit to a job's max CPU time consumed (and temp storage allocation) and hold the job when this limit is reached and send a message to QSYSOPR message queue.
You first get an idea how much CPU time is consumed by the looping job by displaying the problematic job and look at its consumed CPU time. Then you set this max CPU time value in the CPUTIME parameter of the class object that this job uses. When this max limit is reached, the job is held and system message "CPI112D – Job held by the system, CPUTIME limit exceeded" is sent to QSYSOPR and you can monitor for it. The fact that the job is held prevents repetitive messages that you encounter.
Detailed information on this feature is here: Managing Jobs Maximum CPU time and MaximumTemporary Storage at https://www.ibm.com/support/pages/managing-jobs-maximum-cpu-time-and-maximumtemporary-storage
------------------------------
Satid S
------------------------------
Original Message:
Sent: Wed December 11, 2024 02:37 PM
From: Michael Cramer
Subject: SMTP monitor
Hi,
We've ran into a few situations where a program will get caught in a loop and the error routing will overwhelm our email server. I'm looking for a way to either monitor or stop our smtp client on the IBM i from forwarding out these errors. Has anyone tackled this before? I checked the CHGSTMPA settings and there was one flag "Max outgoing e-mail messages" but it doesn't look like it will prevent these loop situations.
------------------------------
Michael Cramer
------------------------------