Frage

newbie here. I am working on an RPG program, and I got this error as I tried to compile it.

It's RNF7023: The compiler cannot determine how the program can end.

Now, commonly, I know this error can be avoided by setting *ON to the LR. I did that on my code, but it still won't compile.

I would also like to note that I have a copy source section in my code. When I try to comment them out (*), the RNF7023 doesn't come out, but my variables, consequently, are undefined.

What am I missing? How does one do a copy source and avoid RNF7023 from happening? Would appreciate any help. Thanks.

Keine korrekte Lösung

Andere Tipps

Difficult to say without seeing code. The only thing I can think of, is that your copycode may have a /EOF statement (where the slash is in column 7). That tells the compiler this is the end.

I might be able to point you in the right direction without having to get too far into your code. RPG's end of processing is done with the *INLR indicator. The RPG runs all executable code until the *INLR is set on or if *INLR is on and it runs out of executable code.

Now with that said, the *INLR has to be in your MAIN if you are using copy source,etc... it can't be in a /COPY.

Personally a good habit if you are a newbie (and I was once) is to in your RPG program, turn on *INLR as the first executed line of code. I have been doing that for 10 years in thousands of RPG programs. What this does is sets up an exit for the program so that when all executable lines of RPG has completed, the program ends.

Now all you have to do is write a good program with defined processes.

Good Luck.

Mike

Look at all your other errors. There may be some other syntax error which then causes the compiler not to recognize the statement setting *LR on. One category of syntax error that can sometimes be easy to overlook is missing items, such as a missing semi-colon, or an apostrophe to terminate a string literal.

You might try editing your question, to show us some relevant section of code.

/* Prefix each line of code with four spaces,
   So that it appears in a code block like this
*/

But if you want to show the entire program or long sections, then post it at codereview.stackexchange.com, and you may link to it here.

What's in the /COPY? It sounds to me that you may have for instance C,D, and P specs. So when the compiler hit's the P specs, it considers the mainline done. If this is the case, there should be another error (warning?) at the first C spec after the /COPY saying it is out of sequence.

More than 6 years later, and this unanswered question is the first search result when searching for RNF7023.

For me, this was happening because the /copy members and my code were a mix of fully-free (**free) and partially-free (/free). Since **free allows code to start in column 1, but /free must start in column 8, they don't play together nicely. Once I changed them to use the same formatting, the program compiled normally.

More than 7 years later, and this unanswered question is the first search result when searching for RNF7023.

For me, this was happening because i Projects somehow got out of sync with my local copy of the source, and the local source did not have any statements.

I copied everything from the i Projects instance into the clipboard then pasted it into the local source and added the source back to i Projects.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top