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




If the sub-procedure is in a program, you will need to LR the program
when you are thru with it.

Whether or not *INLR has an effect has nothing to do with whether it's a prgoram or service program. Instead, it has to do with whether it's a NOMAIN module or not.

*INLR is only an indicator. It's just a variable that stores true or false. In order for it to have any effect, the program has to run a routine that checks the value of *INLR, and uses it to decide whether or not to do something.

The RPG cycle is one such routine. There's a point in the RPG cycle where it checks *INLR, and if it's on, it closes the files and ends the program.

So if you're only calling subproceudres in the module, and never using the main procedure, and never executing the RPG cycle, *INLR will have no effect.

It doesn't matter where you've put the module -- service program or program -- they work the same way.


If it is in a service program, in general it is not a good idea to close
the file.  You will probably need to run it in a *new activation group.

Since this is being called repeatedly, using a *NEW activation group would be a bad idea. The only difference between *NEW and a named activation group is that *NEW is automatically reclaimed when the program that created it ends.

That means that if you call a program defined with *NEW, it creates & deletes the activation group on every call. If you have lots of things loaded into it, they all get removed from memory, and their files closed, etc. That can potentially take a fair amount of time. Certainly not the sort of thing you want to do in a loop in a batch job.

Instead, use a NAMED activation group. When you're done calling the program and you want the files closed, reclaim the named activation group. Presto! The programs are unloaded from memory and the files closed.

If you think of an activation group as a container that you put things in, it's really very easy to understand. IF you put all of your toys in a box, then throw away the box, all of your toys get thrown away.

If you put all of your programs in an activation group, then reclaim that activation group, all of the prgorams get removed from memory, their files closed, etc.



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.