$! 28 Jamuary 2004. SMS. $! $! Check the status of the P1 batch job. $! $! $! Get this SCS node name. $! $ node_name_node = f$edit( f$getsyi( "scsnode"), "trim") $! $ job_found_local = 0 $ job_found_remote = 0 $! $ queue_loop: $ queue_name = f$getqui( "DISPLAY_QUEUE", - "QUEUE_NAME", - "*", - "BATCH, WILDCARD") $! $! Get node name of queue. $! $ node_name = f$getqui( "DISPLAY_QUEUE", - "SCSNODE_NAME", - "*", - "ALL_JOBS, FREEZE_CONTEXT") $! $ node_name = f$edit( node_name, "trim") $! $ if (queue_name .eqs. "") then goto end_of_search $! $ job_loop: $! $ job_name = f$getqui( "DISPLAY_JOB", - "JOB_NAME", - , - "ALL_JOBS, BATCH") $! $ if (job_name .eqs. "") then goto queue_loop $! $ if (job_name .nes. p1) then goto job_loop $! $ status = f$getqui( "DISPLAY_JOB", - "JOB_STATUS", - , - "ALL_JOBS, FREEZE_CONTEXT") $! $ state = "" $! $ if (status .eq. 2) $ then $! $ state = "executing" $! $ else $! $ if (status .eq. 256) $ then $! $ state = "starting" $! $ else $! $ if (status .eq. 512) $ then $! $ state = "scheduled" $! $ else $! $ if (status .eq. 2048) $ then $! $ state = "pending: " $! $ pend_reason = f$getqui( "DISPLAY_JOB", - "PENDING_JOB_REASON", - , - "ALL_JOBS, FREEZE_CONTEXT") $! $ if (pend_reason .eq. 32) $ then $! $ reason = "queue busy" $! $ else $! $ if (pend_reason .eq. 64) $ then $! $ reason = "queue state" $! $ else $! $ reason = "code ''pend_reason'" $! $ endif $! $ endif $! $ state = state+ reason $! $ endif $! $ endif $! $ endif $! $ endif $! $ if (node_name .eqs. node_name_node) $ then $ job = p1 $ job_found_local = 1 $ else $ job = p1+ " ("+ node_name+ ")" $ job_found_remote = 1 $ endif $! $ write sys$output " ''job' is ''state'." $! $ goto queue_loop $! $ end_of_search: $! $ if (.not. job_found_local) $ then $ if (job_found_remote) $ then $ write sys$output " ''p1' job not found on ''node_name_node'." $ else $ write sys$output " ''p1' job not found." $ endif $ endif $! $ status = f$getqui( "CANCEL_OPERATION") $! $ exit $!