× 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.



Hi, James:

Yes, there are several ways to accomplish this.

1.

immediately after the SBMJOB command ,you can retrieve the
completion message CPC1221 from the job log of the current job, and
that gives you the qualified job name, e.g. "220931/MSW/DUMMY" from
which you can extract the components job #, user and job name --
issue DSPMSGD CPC1221 and select "2. Display field data" for
details. Then, given that information, you can use any one of a
number of APIs to find out the status of said job ... -or-

2. on the SBMJOB command, specify a message queue for the MSGQ
parameter. Prompt SBMJOB and F10=Additional parameters and page
down to the "MSGQ" parameter and press F1=Help to read about this. The help text says: "Specifies the message queue to which a
completion message is sent when the submitted job has completed
running, either normally or abnormally." So then, you can just
"wait" on this message queue for a message to arrive. Note that this
message queue cannot be in QTEMP; it must be in a "real' library. You could create a "temporary" message queue, such as:

CRTMSGQ MSGQ(QGPL/MSGQnnnnnn)

where "nnnnnn" is the current job #, just for this purpose. That
way, you should not have to worry about any other messages arriving
on this message queue. Once you are done waiting for that job to
complete, you may want to delete this "temporary" message queue.

Hope that helps,

Mark S. Waterbury

> On 7/22/2013 1:14 PM, James H. H. Lampert wrote:
Is there a way, from a CL program, to submit a batch job, and wait for
it to end before proceeding?

i.e.:
...
SBMJOB CMD(FOO) JOB(BAR)
<wait for BAR to finish>
<check the results from BAR>
...

--
JHHL


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.