Re: If an RPG program is forcibly terminated . . .

"James H. H. Lampert via RPG400-L" <[email protected]>
Newsgroups gmane.comp.lang.as400.rpg
Message-ID <[email protected]>
On 9/9/25 11:25 AM, Daniel Gross wrote:
> A) if the program check for %SHTDN() regularly it can sense the *CNTRLD job ending.
> 
> B) if you write a procedure the ON-EXIT procedure gets executed even when the job ends *IMMED
> 
> C) this can also be done via APIs for "traditional" programs (CERRTX) and even for service programs (CEE4RAGE2 - when the activation group ends).

Dear Mr. Gross:

Thanks.

Option A has the problem that I can't be sure it's not going to be *IMMED.

Option B has the problem that this is a Cycle program, and the 
additional problem that I can't find any "ON-EXIT" in any of my RPG docs 
(including the V7R1 reference).

So I went with Option C, and I found Joe Pluta's article on how to use 
it, on mcpressonline.com. A test program (that rides The Cycle through a 
file, shelling out a one-second DLYJOB for each record via QCMDEXC) has 
given me proof-of-concept.

--
JHHL
-- 
This is the RPG programming on IBM i (RPG400-L) mailing list
To post a message email: [email protected]
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request-+hD5IHI5Xscn3HwCXmMcX9BPR1lH4CV8@public.gmane.org
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.

Please contact support-FMtJrHiV//lnDLsaKlm4mFaTQe2KTcn/@public.gmane.org for any subscription related questions.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.