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



Alex, normally you would not be using spawn to run jobs in QBATCH. Spawn is
used to connect to pre-start jobs.

You define a subsystem with pre-start jobs and then you use Spawn to take
over one of these jobs. This is not something that you would want to do in
QBATCH.

Having said that I have an open source project that I have been working on.
that consists of a socket server spawning socket worker jobs. One part of
that project is a service program XVSPWN that wraps up the spawn interface
to make it easy to use.

Could I know what you are planning to use the spawn api for. It sounds like
you might be looking for pre-start jobs.


On Thu, May 26, 2016 at 3:34 AM, Scott Klement <rpg400-l@xxxxxxxxxxxxxxxx>
wrote:

Hello Alex,

On 5/26/2016 2:09 AM, amunra@xxxxxx wrote:

Speaking about not CL technique.
Does anybody use spawn() API to create a separate jobs?
Some years ago I tried to use it, but I didn't find the way to create
job
in different subsystems.
Does anyone know if there is a way to run jobs in QBATCH subsystem?



I use the spawn() API quite often. But it is important to understand that
it does not simply submit a new job -- instead it creates a "child
process". Your job that calls spawn() is considered it's parent.

Due to the nature of a child process, it must always be in the same
subsystem as the parent job. So spawn() cannot cause a job to run in a
different subsystem.

There are other things about child processes that are different, too...
for example, even after the child process ends, some memory from it is kept
around until the parent process calls wait or waitpid to get it's exit
status, etc. Also, child processes inherit a number of things from the
parent. For details on all these things, see the manual for spawn() in the
IBM Knowledge Center.

For what you are doing, you might consider using the SBMJOB command
instead of the spawn() API.

-SK

--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L)
mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.