HI Deepak,
The AFTER will take effect only after JOBA finishes. It's meant for JOB level relationship.
If you want JOBB runs right after STEP4 in JOBA completes, you can:
- Use STEPEND monitoring: Having JOBA being tracked by a tracking model with STEPENDEVENT defined
DEFTM TRAKSTEP .... STEPENDEVENT(ESP.STEP_MON)
And in event ESP.STEP_MON, check if it's STEP4 and if RC=0, If both are good, then issue AJ command to remove the dependency to JOBA, like:
ESPNOMSG AJ JOBB DROPDEP(JOBA)
See following for more details:
https://techdocs.broadcom.com/us/en/ca-mainframe-software/automation/ca-workload-automation-esp-edition/12-0/advanced-using/trigger-events-through-job-monitoring-and-alert-processing.html
https://techdocs.broadcom.com/us/en/ca-mainframe-software/automation/ca-workload-automation-esp-edition/12-0/reference/commands/appljob-aj-command-control-jobs-and-subapplications.html
- Use RESOURCE and STEPEND, like below:
Note: presume XXX is a renewable resource with MAX(1)
JOB JOBB
RESOURCE ADD(1,XXX)
...
ENDJOB
JOB JOBA
PRIORITY 50
RESOURCE ADD(1,XXX)
STEPEND STEPNAME(STEP4) RELRES(1,XXX)
...
ENDJOB
As you can see, the AFTER is replaced by the STEPEND statement. and to make sure JOBA gets the resource first, add PRIORITY 50 to give it higher priority.
Hope this helps,
Lucy
Original Message:
Sent: 01-11-2021 08:08 AM
From: Deepak Karunakaran
Subject: Releasing a Job based on Predecessor Job Specific Step completion
I have coded as below. JOB B should run immediately once STEP4 in JOBA is completed successfully, but JOB B is getting kicked off only entire steps in JOB A is done.
JOB JOBB
RUN WORKDAYS
AFTER ADD(JOBA) COND(STEPRC('-.STEP4',0))
ENDJOB
Just wondering whether STEPRC Condition should be in RELEASE ADD Statement under JOBA definition will work or is there some other condition in place to kick off the job B immediately once Specific Step in Predecessor job JOBA is done. Please Advise