When I published my article about Program to alert when jobs' CPU percentage becomes too high someone messaged me asking could I think of something that would do the same when the total CPU exceeded a certain percentage. The answer is, of course, "Yes".
Before I create a program we need to consider the whether the partition that the program will be run on is "capped" or "uncapped". What does that mean?
When a partition is capped it cannot use more than its allocated processing units, in other words it can never exceed 100% CPU usage.
While an uncapped partition has its base entitlement of the processing units, but can borrow unused processing power from the other partitions if available. This means that its CPU usage can exceed 100% of the partition's resources.
This means that 90% CPU utilization could be more concerning on a capped than an uncapped. Keep this in mind when you look at my example program.
I always use ACS's Run SQL Scripts, RSS, to develop the SQL statements I will be including in a RPG program. I can get the elapsed CPU percentage from the SYSTEM_STATUS SQL table function:



