[AWA] How to write scripts that auto cancel manually job with status "Waiting for host"

Document ID : KB000113322
Last Modified Date : 12/09/2018
Show Technical Document Details
Recently one of server down which caused agent inactive, but our Jobs with that agent still pending with "Waiting for the host" After 2 days we noticed of this, we had to cancel it manually. We want to check if possible that after certain period those jobs with "Waiting for the host" will be auto ended. How should we set up for this.
You can use another Jobs run in another agent that active right after the main jobs (jobs that you want to cancel manually when Waiting for host status appear) active.
As you can see in the images, I use JOBS.WIN.NEW.4 to monitor JOBS.WIN.NEW.5.
- Put a script to active Jobs4 at the end of Jobs5 process

User-added image
- Put in Jobs4 wait command for amount of time

- Put in Jobs4 post process the scripts that monitoring the Jobs5 status, and cancel Jobs5 when it has "waiting for host" status.

User-added image

You can use a set of SQL VARA and a script object to perform cancel action. You can run the script every time you have "Waiting for host" job.

The SQL VARA statement is:
select EH_Ah_Idnr from EH where EH_status='1696'
User-added image

The Script content is:
User-added image
Additional Information:
Script to active another job in main job process

Scripts to cancel manually job with "Waiting for host" status:
:IF &STATUS# = "1696"