×
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.
LR has not been required since the RETRN opcode was added to RPG/400,
quite a long time ago.
Several people have stated that all you need is a 'return' in your
program. That's not quite true, the return needs to be in the MAIN
procedure of the module, and you will not need LR. If you don't have a
return in the main procedure (but do have it in subprocedures) that
should still trigger a 'can't see how program would end' compiler error.
LR, however, can be anywhere in the module (LR is global, so it
doesn't matter if it's in a subprocedure.)
If you are writing a nomain or linear-main module, you likewise will not
need either LR or RETURN (except in subprocedures that return values.)
The fact that you say your program is looping indefinitely makes me
think that this is a cycle-main procedure (i.e. a traditional main
procedure) and that neither LR nor RETURN is occurring. This doesn't
mean, however, that they aren't in the code somewhere... they might be
in some code that's not being called, maybe because it's conditioned, or
something like that.
Either way, this should be easy to fix.
On 11/21/2013 3:17 PM, Englander, Douglas wrote:
We are on V7R1. I just compiled a program that did not reference LR anywhere. It compiled. I ran it, and it does not stop.
Is this a new enhancement that we can compile RPG programs without LR? This program does not use primary files either. I was expecting the "I can't determine how the program ends" error message from the compiler, but instead got a 00 highest severity message.
Doug
As an Amazon Associate we earn from qualifying purchases.