Not sure I understand exactly what you're doing (I am mystified by "q scr cancel"?), but maybe this can help. A common workaround is to have the script check a return code, then define (or change the start time of) an admin schedule that invokes a script, which can check a return code, define an admin schedule that invokes a script, etc.
For instance here is how I prevent a reclaim stgpool from running if the backup for a particular client (which backs up direct to tape in that pool) is still running. If the script finds a backup in progress, it reschedules for 2 hours later, otherwise it runs immediately: tsm: LOCAL_SERVER1>q script ELPROBLEMO_reclaim_offsite f=raw /* This script checks to see if ELPROBLEMO is currently backing up before starting reclamation on the */ /* ELPROBLEMO_OFFSITE stgpool */ /* If ELPROBLEMO is not currently backing up, it starts ELPROBLEMO_reclaim_offite */ /* If ELPROBLEMO is currently backing up, this script reschedules itself in 2 hours */ /* see if ELPROBLEMO is currently backing up */ select * from sessions where client_name='ELPROBLEMO' /* and is holding a tape? */ if (RC_OK) goto reschedule /* ELPROBLEMO not running, so start the reclamation */ reclaim stgpool ELPROBLEMO_offsite_pool threshold=65 duration=480 wait=yes exit RESCHEDULE: update schedule resched_ELPROBLEMO_recl_offsite type=admin starttime=now+2 expiration=today exit And here is the definition of the resched schedule that got updated: tsm: LOCAL_SERVER1>q schedule resched_ELPROBLEMO_recl_offsite type=admin f=d Schedule Name: RESCHED_ELPROBLEMO_RECL_OFFSITE Description: Command: reclaim stgpool ELPROBLEMO_OFFSITE_POOL THRESHOLD=65 DUR=480 wait=yes Priority: 5 Start Date/Time: 02/18/2011 11:57:56 Duration: 10 Minute(s) Schedule Style: Classic Period: One Time Day of Week: Any Month: And you could easily change the RESCHED_ELPROBLEMO_RECL_OFFSITE to invoke another script that checks again to see if the backup is STILL running, and do the reschedule again, etc. W