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

... seems only be half of the truth. Workmanagement Guilde says:

"Examples for ADDPJE

Example 1: Specifying Additional Prestart Jobs

ADDPJE SBSD(QGPL/PJSBS) PGM(QGPL/PGM1) INLJOBS(15)
THRESHOLD(5) ADLJOBS(10) WAIT(*NO)"

They don't tell how the example PGM1 is looking like, but it seems to be possible to make a user written programm a prestarted job. Communication between a listener - acting as dispatcher - and the clients is done by takedescriptor or via sendmsg() recvmeg(). There are examples available, but they don't tell how to make it a prestarted job.

In my opinion prestarted jobs where the first attempt for AS/400 to enable Threading support, without having Threading capable job environments. The "threads" are implemented by independent jobs, without shared memory to each other. Sharing information between the jobs is done by the programmer and some OS400 specific APIs. Later on Unix like thread modell came to AS/400 and since then it was possible to write true multithreaded applications (with some restrictions to RPG and COBOL).

@Jim: Interesting idea to replace an AJE with a PJE to get automatic restart capabilities - I didn't try to do so, because there is a very basic alternative:
create a JOBQ with only one running JOB and let your programm first submit itself to this Q. Once submitted, it will run forever.

Dieter




As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.