The problem is the additional parameter "ENDED_OK". This is only valid for event objects.
If used for other objects, an error code is returned, because a task in a state of "generating" can not be set to an ENDED_OK.
Correct the script in the description above as follows to avoid the error:
:SET &PATIENCE_STATUS# = GET_UC_OBJECT_STATUS(JOBS, &PATIENCE_RUNID#)
:P PATIENCE_STATUS# = &PATIENCE_STATUS#
:SET &CANCEL# = CANCEL_UC_OBJECT(&PATIENCE_RUNID#)
:P Cancel of &PATIENCE_RUNID# returned &CANCEL#
Fix Status: No Fix
Fix Version(s):
N/A