I have recently stumbled on a service program in which *inlr = *on is used after explicit close of a file (code below). It feels rather excessive for me. From what I have found it is rpg cycle that handles releasing of resources. So if there is no cycle (ie. in programs with main/nomain h-specs) there is no way for *inlr = *on to have any effect, but... I have not been able to find any confirmation, and since cycle related issues are very new to me I might be missing something...
if %open(file);
close file;
endif;
*inlr = *on;
return *on;
In short no.
"last record" indicator is only used by the cycle. It's not used in a NOMAIN service program or a linear MAIN program.
The RPG IV Programmer's Guide says
Note No cycle code is generated for subprocedures or when MAIN or NOMAIN is specified on the control specification.
Additional References
IBM's Barbara Morris (RPGLE Compiler developer, in a post to the RPG mailing list)
The linear-main procedure will just end when it gets to the end of the calculations. You can set on *INLR if you want, but it won't do any of the cycle-related things like closing files.
Here is a comparison of a cycle-main module and a linear-main module.http://publib.boulder.ibm.com/infocenter/iseries/v7r1m0/index.jsp?topic=%2Frzasd%2Fsc09250802.htm "