No, I understand the purpose of the PJ. But, I have used prestart jobs like autostart jobs without spawn. They run until you tell them to wait for something. The only difference I have seen from Autostart jobs, and the advantage of using them instead of an autostart, is they come back after they end unless you end them using ENDPJ. I have never used a PJ for a communications job (with a communications entry), and never used spawn. But I have used prestart jobs, and they did more than just sit there. In fact, the IBM documentation says that you should have the PJ do more than simply get the job started if you want to get the most out of it.

Mark Murphy
STAR BASE Consulting, Inc.
mmurphy@xxxxxxxxxxxxxxx


-----Alan Campin <alan0307d@xxxxxxxxx> wrote: -----
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxx>
From: Alan Campin <alan0307d@xxxxxxxxx>
Date: 09/15/2016 05:58PM
Subject: Re: Prestart jobs... how does it work ?


No, I don't believe so. I think you misunderstanding the purpose of the
pre-start job.

It goes back to when IBM first started supporting Client/Server type
applications.

You would enter a user id and password (or a program would) and then you
would sit and sit for what seemed like an enternity until finally you got
connected and heaven help you if you had to log on again and again.

What all that time was the AS/400 creating a job. A very slow and expensive
process.

So IBM created pre-start jobs. Basically all that IBM is doing starting up
a certain number of jobs that simply sit and wait for work.

They never actually do anything unless you use spawn. They only exist so
that processing can start quickly.

The only way that you can use a pre-start job is use spawn.

This is what the pre-start job entry looks like in my subsystem.

Subsystem description: IISUB Status: INACTIVE

Program . . . . . . . . . . . . . . . . . . . . : QP0ZSPWP
Library . . . . . . . . . . . . . . . . . . . : QSYS
User profile . . . . . . . . . . . . . . . . . . : IIUSER
Job . . . . . . . . . . . . . . . . . . . . . . : IISCKW
Job description . . . . . . . . . . . . . . . . : IIJOBD
Library . . . . . . . . . . . . . . . . . . . : DEVIILIB
Start jobs . . . . . . . . . . . . . . . . . . . : *YES
Initial number of jobs . . . . . . . . . . . . . : 3
Threshold . . . . . . . . . . . . . . . . . . . : 2
Additional number of jobs . . . . . . . . . . . : 2
Maximum number of jobs . . . . . . . . . . . . . : *NOMAX
Maximum number of uses . . . . . . . . . . . . . : 200
Wait for job . . . . . . . . . . . . . . . . . . : *YES
Pool identifier . . . . . . . . . . . . . . . . : 1

Note the QP0ZSPWP program. This is the program you must use if you want a
pre-start job, no threads allowed. There is a different program with thread
support.

The point being you must use one of two program names supplied by IBM. You
cannot just put the name of a program you want to run.

So you start your subsystem, it starts the number of jobs you requested and
they sleep until you issue a spawn which grabs one of the them and all
calls the program you requested.

Each time it finishes processing, everything is dumped and the job returns
to a empty job state. If you specify one for number of uses, the job is
destroyed and another one created every time.

This is my understanding of the process. As far as I know, you cannot run
anything except the program IBM supplies to use pre-start jobs. .

If you want a job that processes on startup, you would use a Auto-Start job
entry in the subsystem.

Actually, there would not be much reason to not have a auto job. How would
you run spawn without something to run it?

Hopefully I am not misunderstanding your response.

On Thu, Sep 15, 2016 at 2:25 PM, Mark Murphy/STAR BASE Consulting Inc. <
mmurphy@xxxxxxxxxxxxxxx> wrote:

But they could be written to do something. That job that you use as an
Autostart could be set up as a prestart if there is a problem if it goes
away.

Mark Murphy
STAR BASE Consulting, Inc.
mmurphy@xxxxxxxxxxxxxxx


-----Alan Campin <alan0307d@xxxxxxxxx> wrote: -----
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxx>
From: Alan Campin <alan0307d@xxxxxxxxx>
Date: 09/14/2016 03:05PM
Subject: Re: Prestart jobs... how does it work ?


Not completely true. The operating system starts pre-start jobs based on
the number of initial jobs in request in the subsystem pre-start job entry
but they just sit there. They are pre-started but they are not doing
anything. They just go to sleep. It is the spawn that cause the operating
system to look for a pre-start job and execute the program that you
requested. Unless you run spawn, the jobs will simply sit there until the
subsystem ends.



On Wed, Sep 14, 2016 at 11:55 AM, Mark Murphy/STAR BASE Consulting Inc. <
mmurphy@xxxxxxxxxxxxxxx> wrote:

Why do you need an Autostart? Prestart jobs start automatically as well,
and act just like Autostarts, except prestarts don't always go away when
ended, the system starts them back up if necessary.

Mark Murphy
STAR BASE Consulting, Inc.
mmurphy@xxxxxxxxxxxxxxx


-----Alan Campin <alan0307d@xxxxxxxxx> wrote: -----
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxx>
From: Alan Campin <alan0307d@xxxxxxxxx>
Date: 09/14/2016 02:46PM
Subject: Re: Prestart jobs... how does it work ?


The pre-start job thing is not to hard. The hardest part is spawn api
which
is why I wrapped it in a service program.

To use pre-start jobs, you start with a sub-substem. Normally you would
want a dedicated subsystem.

You create a subsystem description, two job descriptions (One for
pre-start
jobs and one for autostart jobs).

You create a job queue

You write a program for use as an auto-start program. Your controller.

You add an autostart entry to the sub-system.

You add a single routing entry.
You add a job queue entry.
You add a pre-start job entry.

You write a program to is be started up when you spawn.

You start up your subsystem.

The controller job is responsible for running the spawn, at least the
first
one.

On Wed, Sep 14, 2016 at 11:24 AM, Chris Bipes <
chris.bipes@xxxxxxxxxxxxxxx

wrote:

The easiest way to submit more jobs is to have one job that does a
message
peek every so often and sees how many queue entries there are. If
greater
than a pre-described number, submit another processing job.

A second method is to have the process job look at how long an entry
was
sitting on cue, if greater than a pre-described time, submit another
processing job. I use a data area to keep track of the number of jobs
running but you can also use an API to get the count. So when a data
queue
wait times out, you check to see if there are more than a pre-described
number of job running, if so, you end.


Chris Bipes
Director of Information Services
CrossCheck, Inc.

-----Original Message-----
From: MIDRANGE-L [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of
Alan Campin
Sent: Wednesday, September 14, 2016 11:09 AM
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxx>
Subject: Re: Prestart jobs... how does it work ?

If you are interested, I have just done a lot of work with pre-start
jobs
for an open source project I am working on.

As part of that project I have a service program that provides a simple
interface to submit pre-start jobs using spawn. That code is available.

The problem I see here is that you are going to need more than
pre-start
jobs. All they do is give you a way to start quicker.

The problem is that you have to know when to submit a new job. Ending
the
job is pretty easy. You just time out on the data queue if you have not
received work for some period of time.

The trickee part is knowing when to startup new jobs.

The only good solution I can think of is to have each processing job to
send a message through another data queue to a single program saying
how
long it had to wait. When time waiting exceeded a certain value, start
another job.

Another possibility might be to have to processing check the time
waiting
and do the submit if exceeded.

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

Please contact support@xxxxxxxxxxxx for any subscription related
questions.

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

Please contact support@xxxxxxxxxxxx for any subscription related
questions.
--
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.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.

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

Please contact support@xxxxxxxxxxxx for any subscription related
questions.
--
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.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.


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.