Our internal function waitForJob checks the status of a job in a loop with increasing time interval. If the RC is not CC 0000, waitForJob fails with JOB12345 doesn't finish within max waiting period.
It looks like there is another possible status of SPIN with no RC, which also indicates the job ended:
* Succeeded with job ID JOB12345
* Exit code: 0
* Output:
JOB JOB12345 submitted from stdin
- Wait for job JOB12345 completed, starting at Tue Jun 02 2026 12:34:56 GMT+0800.
* Wait for 1 seconds
-- Running /zowe/bin/utils/zowex job view-status JOB12345 --rfc
* Job (ZWEGENER) status is ACTIVE,RC=
* Wait for 5 seconds
-- Running /zowe/bin/utils/zowex job view-status JOB12345 --rfc
* Job (ZWEGENER) status is SPIN,RC=
* Wait for 10 seconds
-- Running /zowe/bin/utils/zowex job view-status JOB12345 --rfc
* Job (ZWEGENER) status is SPIN,RC=
* Wait for 20 seconds
-- Running /zowe/bin/utils/zowex job view-status JOB12345 --rfc
* Job (ZWEGENER) status is SPIN,RC=
* Wait for 30 seconds
-- Running /zowe/bin/utils/zowex job view-status JOB12345 --rfc
* Job (ZWEGENER) status is SPIN,RC=
* Wait for 60 seconds
The ZWEGENER job in that example ended within 7 seconds, however reported by waitForJob as unfinished.
Our internal function
waitForJobchecks the status of a job in a loop with increasing time interval. If the RC is notCC 0000,waitForJobfails withJOB12345 doesn't finish within max waiting period.It looks like there is another possible status of
SPINwith no RC, which also indicates the job ended:The
ZWEGENERjob in that example ended within 7 seconds, however reported bywaitForJobas unfinished.