I have an issue with EXTERNAL SCOPE keyword. I have coded an appl which waits on a job in another event using the EXTERNAL SCOPE keyword
This appl will be triggered multiple times by MQ. Everytime it is triggered, it should check if a particular job has run in the last 8 hours, before releasing the job to run.
The appl is working fine only the 1st time it is triggered by MQ. When MQ triggers it the 2nd time, it is not running, even though the EXTERNAL condition is satisfied.
Here is the sample script.
APPL TEST1 WAIT NOPOST_WHILE_WAITING
JOB J2 EXTERNAL SCOPE (-08)
DSNAME HLQ.APPID.TS1 ANYCLOSE
APPL TEST2 WAIT NOPOST_WHILE_WAITING
JOB J1 EXTERNAL SCOPE (-08) APPLID(TEST1) /* This job will run only once in the night in TEST1 Event*/
JOB J2 /* This job should run multiple times in a night (once for each file) in the MQ queue*/
I am not sure if there is a problem with the way NOPOST is coded.
Appreciate if someone could throw light on what I am missing. Thanks.
I guess I don't understand why in TEST1 , JOB2 has an EXTERNAL statement combined with a DSTRIG statement. It seems to me that if you were doing a file watcher, it would be separated out into a separate task. If you want the application to run whenever the GDG comes in, you may consider using a DSTRIG event rather than an external.
Also, if you're unsure of whether your NOPOST is a problem, consider removing it and seeing if the behavior changes.