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



Dave,

Looks like you are running it as a CGI program from the web server.
We run most of our using *CALLER and have not had any issues.
Using *NEW will mean every time the web executes the program there will be extra overhead when the program activates.


Running in the Default Activation group is not the end of the world for an RPGLE program.
I'd would definitely suggest running in at least *CALLER with all RPGLE programs.

For an ILE-RPG program complied with CRTBNDRPG, it's important to set on INLR before the program exits. It closes files and deallocates automatic storage memory. It also allows the *INZSR subroutine to run again the next time the program is called. This even happens for programs compiled with the default activation group.

AFAIK the only time INLR would do nothing for an RPGLE program, is if that program was a Linear Main program or a Module compiled in a service program.
I'm not sure what other scenario would make it so INLR does nothing for an RPGLE program. Maybe someone else can shed light on that apparent RPG3 mysticism.



Setting the activation group is real easy in an RPGLE program.
We use a copy book to setup the activation group in 99% of our RPGLE programs.

/COPY QCPYSRC,HSPECLE

H OPENOPT(*NOINZOFL) OPTION(*NODEBUGIO:*SRCSTMT)
H BNDDIR('xxxxxxxxx')
/IF DEFINED(*CRTBNDRPG)
/IF NOT DEFINED(HSPECLE_OVERRIDE_ACTGRP)
H DFTACTGRP(*NO) ACTGRP(*CALLER)
/ENDIF
/ELSE
/IF NOT DEFINED(HSPECLE_OVERRIDE_NOMAIN)
H NOMAIN
/ENDIF
/ENDIF



Then, when the next programmer comes along and does a 14 to compile the RPGLE or SQLRPGLE type, the program uses the control-spec setting.

On our system the control spec values for DFTACTGRP and ACTGRP override the values set on the CRTBNDRPG command. I'm not sure why it would be any different on your system.

Again, I'd would definitely suggest running in at least *CALLER with all RPGLE programs.


Using *NEW just to "unset" a couple of pointers that no longer point to allocated memory, seems like an extreme solution.
Especially when setting on INLR before you exit is such a simple approach.
Yes, I understand it "works", I'm just trying to stress the extra overhead involved.
It is also not a good idea to use it in "all" of your programs.

Using *NEW should be for only edge cases where you are trying to deal with other things. The extra overhead tends to get too expensive if you use it in ever program.

So you would use *NEW for the entry program, but then all the programs used by that *NEW program would all be set to use *CALLER so they can all share the activation group.
If each one uses *NEW you would have a lot of overhead in that system. Especially if you also tend to use service programs that are in *CALLER and get activated again for every *NEW activation group program they are triggered from.

Chris Hiebert
Senior Programmer/Analyst
Disclaimer: Any views or opinions presented are solely those of the author and do not necessarily represent those of the company.

-----Original Message-----
From: RPG400-L <rpg400-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of Dave
Sent: Thursday, July 29, 2021 7:51 AM
To: rpg400-l@xxxxxxxxxxxxxxxxxx
Subject: RE: Pointer Reset operation?

Chris,

Thanks for the reply.

The if pstdin = *null; was just for testing and debugging in order to
understand what was going on.
The problem is really one of implementing ILE programs in a totally non
ILE.

This is an extract from the callstack of the job :

----Groupe d'activation-----
Programme Nom Numéro
QP0ZPCP2 QSYS *DFTACTGRP 0000000000000001
QZSRCGI QHTTPSVR *NEW 0000000000000011
MyWebPgm MyLib * DFTACTGRP 0000000000000002

I seem to remember from years ago when I worked a lot in an ILE, that INLR
had no effect on an ILE RPG if it was running in the DFTACTGRP.
It seems I have three choices :

Compile my program with ACTGRP *CALLER but make sure all intermediate
programs (for example a CLP that sets the library list) are not in the
DFTACTGRP;
This could be problematic as there is no infrastructure for compiling and
it only needs another programmer to come along and enter option 14.

Let my program run in the DFTACTGRP and manage file opening (seems
costly
to me)

Compile with ACTGRP *NEW


As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.