*NEW is a horrible idea for trigger (or recursive) programs...
As well as for embedded SQL Programs. ODPs (Open Data Path) cannot stay open, i.e. they will get closed as soon as the activation group is closed ... at the end of the program.
Every time the program runs all embedded SQL Statements have to run through a FULL OPEN (complete optimization) which is very time consuming compared with a PSEUDO OPEN (i.e. reusing the already established ODPs)

Mit freundlichen Grüßen / Best regards

Birgitta Hauser
Modernization – Education – Consulting on IBM i
Database and Software Architect
IBM Champion since 2020

"Shoot for the moon, even if you miss, you'll land among the stars." (Les Brown)
"If you think education is expensive, try ignorance." (Derek Bok)
"What is worse than training your staff and losing them? Not training them and keeping them!"
"Train people well enough so they can leave, treat them well enough so they don't want to. " (Richard Branson)
"Learning is experience … everything else is only information!" (Albert Einstein)


-----Original Message-----
From: RPG400-L <rpg400-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of Charles Wilt
Sent: Friday, 17 April 2026 16:11
To: RPG programming on IBM i <rpg400-l@xxxxxxxxxxxxxxxxxx>
Subject: Re: *INLR

*NEW is a horrible idea for trigger (or recursive) programs...
*CALLER is the best practice for trigger programs

Why would you need a recursive trigger program?

And assuming you built it before we got linear main programs in ILE RPG, which can be recursive.
Then a better solution would have been an ILE CL entry point using CALLPRC to an ILE RPG subprocedure.

Charles

On Thu, Apr 16, 2026 at 6:03 PM Marco Facchinetti < marco.facchinetti@xxxxxxxxx> wrote:

Agreed but with sbmjob you have both: init job + groups creation.

Untill now we used *New only for triggers programs (recursive).

Best regards
--
Marco Facchinetti

Mr S.r.l.

Tel. 035 962885
Cel. 393 9620498

Skype: facchinettimarco


Il giorno gio 16 apr 2026 alle ore 23:30 Charles Wilt <
charles.wilt@xxxxxxxxx> ha scritto:

On Thu, Apr 16, 2026 at 2:34 PM Marco Facchinetti <
marco.facchinetti@xxxxxxxxx> wrote:

If PgmB was designed to run in batch and isn't a program of a few
hundred
lines, I wouldn't dare hope that everything will work just by
activating
LR
on exit. You should be sure it doesn't call other programs or use
service
programs.
If you can guarantee this, you could save yourself the cost of a
new
job
with every invoice by modifying PgmB with ACTGRP(*NEW).


OP please don't. Calling a PGMB that uses ACTGRP(*NEW) in a loop is
going
to hurt.
Not quite as bad as submitting PGMB to batch, but still, never a
good
idea.

If you've ever had IBM perform a performance analysis on your
system, one of the key things they report on is activation group
creation and destruction.
Why? Because it's resource intensive, requiring CPU and IO and also
drives
up DB full opens.

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

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription
related questions.


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

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription
related questions.


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

Please contact support@xxxxxxxxxxxxxxxxxxxx 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-2026 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.