× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Alan,

One thing we do with some of our processes here is to have each submitted CL
write an ID (in our case, the CL name) to a common data area. The last thing
the CL does is to clear its name. If at the end the data area is clear we
know we did not have any cancelled program.

It goes something like this:

SBMJOB CMD(call CL_PROG_1 ('01')) /* '01' would be the position ID */
SBMJOB CMD(call CL_PROG_2 ('02')) /* '02' would be the position ID */
...
Each CL has:
PGM &POS_ID
dcl &pos_id *dec len(2, 0)

chgvar &posdta &pos_id
IF (&posdta *NE 01) DO
chgvar &posdta ( (&posdta * &lendta) + 1)
ENDDO

The first thing the CL do is to check that the &POS_ID data in the data area
is empty. If it is not, it sends a message to QSYSOPR, indicating a
(possible) problem.

If empty, it writes its name beginning at &posdta and proceeds with the rest
of its instructions. At the end, it clears the info at &posdta,

These are long-running jobs, that must end at a certain time. There is a
scheduled CL that checks if the *DTAARA is empty. If not, it sends an email
to the people responsible for this particular process.

Regards,

Luis Rodriguez
IBM Certified Systems Expert — eServer i5 iSeries
--



On Mon, Sep 12, 2011 at 11:03 AM, Alan Shore <ashore@xxxxxxxx> wrote:

Even though the web page sent by Sean
http://www.itjungle.com/fhg/fhg033005-story02.html
has piqued my interest, I am leaning more towards the data area scenario
As you say Joe - Simple (as my wife would say 'If the shoe fits')


Alan Shore
Programmer/Analyst, Direct Response
E:AShore@xxxxxxxx
P:(631) 200-5019
C:(631) 880-8640
"If you're going through Hell, keep going" - Winston Churchill


-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx [mailto:
midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Joe Pluta
Sent: Monday, September 12, 2011 11:01 AM
To: Midrange Systems Technical Discussion
Subject: Re: How do you determine when numerous SBMJOBs have ALL finished

On 9/12/2011 9:48 AM, Mark Murphy/STAR BASE Consulting Inc. wrote:
Of course the OP doesn't say whether the jobs must complete successfully,
or just be finished running. The add 1 subtract 1 method does not work if
you are just waiting for all the jobs to be gone. Say something ends
abnormally, the data area will never get back to zero.


The two easiest options are the plus one/minus one data area (for when the
jobs must end successfully) and the lock on the data area for when you only
care when the jobs end. Alan didn't happen to mention what to do when one
of the 17 jobs fails, so I'm still not 100% certain what he wants to do.

A combination of the two is actually pretty slick. You wait until all the
jobs finish via the exclusive lock, and then check the data area.
If it's zero, all jobs finished successfully. If not, then at least one
job failed (in fact, the number in the data area tells you how many failed).
Simple!

Joe
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take a
moment to review the archives at http://archive.midrange.com/midrange-l.

--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.