dSeries has several options for users to force complete a job. The execCommand is a JavaScript feature that can be used in a JavaScript to force complete or change states of an application or a job. Another option is to use ESPMgr utility in the agent to update or complete a job.
Workload Automation Agent: 12.0 or above
ESP dSereis / Workload Automation DE: 12.3 or above
The following command will list all active applications with the date. You can then sort the output by dates and then force complete them via JavaScript or by ESPMgr:
cli dehostname 7500 user <password> 'listapplication APPLICATION("*") state("active")'
An example of an ESPMgr Job in DE (ESPMgr is in the agent directory):
Command: /opt/CA/WA_Agent/ESPMgr
Arguments to pass: "JOB1234/MYAPPL.9/MAIN ACTION COMPLETE Reason("Some REASON")"
Extract on application and generations (Linux only):
cli dehostname 7500 user <password> 'listapplication APPLICATION("*") state("active")' | grep -v -e ":" -e '^$'
The above can be scripted as well, where set the job name and 'application.gen' as variable from the LISTAPPLICATION output and pass it to ESPMgr command. E.g of ESPMgr as a command:
/opt/CA/WA_Agent/ESPMgr "JOB1234/MYAPPL.9/MAIN ACTION COMPLETE Reason("Some REASON")"