In our test, we had TIME=(,5) (that is five cpu seconds) and executed looping program, but we did not get any S322 abend like expected.
We had to cancel IDMS to stop looping.
Should IDMS obey TIME parameter in JCL in case of loop ?
Basically a job abends with S322 when the CPU time is exceeded. But IDMS does not really return control to the z/OS system until SHUTDOWN. When the CPU limit is exceeded z/OS tries to cancel the CV TCB.
This can result in SA03 or SEC6 abends during SHUTDOWN. The SA03 occurs because the CV TCB has attached one or more OS subtasks that has not ended. The SEC6 abend is due to the TCB being terminated by z/OS and certain threads or subtasks are not terminated 'normally'.
Usually the CV has already completed SHUTDOWN at this point and no rununits would be rolled out at the next execution. We recommend setting up the JCL to have a TIME= parameter that nullifies the CV being cancelled due to the CPU being exceeded.
You don't see the S322 because the other abends occur first.
To abend looping tasks in a CV you should use internal mechanisms. A tight loop in user mode is abended after exceeding the RUNAWAY INTERVAL.
Other loops can be stopped by setting task limits.