Tuesday, December 16, 2025

Improvement to RPG compile listing

One thing that has always annoyed me within RPG compiler listings is how it handles long variables names. In the "Additional diagnostics messages" section of the listing it did not list the entire variable name, just the first seven characters followed by an ellipsis ( ... ). This could lead to some confusion if there is more than one variable that have the identical first seven characters.

I know this is an extremely simple piece of code, but it illustrates what happened:

01  **free
02  dcl-s Really_not_this_one char(1) ;

03  Really_long_variable_name = 'X' ;

04  *inlr = *on ;

Line 2: A variable is defined with the name Really_not_this_one.

Line 3: I then use a variable that has not been defined, Really_long_variable_name, that has the same first seven characters as the variable I defined on line 2.

When I compile this it fails with a level 30 error, as the variable on line 3 has not been defined.

When I look in the compile listing I see:

 Msg id  Sv   Statement    Message text
*RNF7030 30        000300  The name or indicator REALLY_... is not defined.

I have the statement number; therefore, I can determine which variable caused the error. But it always annoyed me that the compiler knows the full name, but does not display it.

Within the PTF for RPG that accompanies the latest Technology Refresh for IBM i 7.6 and IBM i 7.5, is the fix for this problem. After the PTFs have been applied, now when I compile the RPG code my message gives me the complete name of the variable:

Msg id  Sv   Statement    Message text
*RNF7030 30        000300  The name or indicator REALLY_LONG_VARIABLE_NAME is not
                           defined.

This is so much better. Now I know what variable has not been defined without having to go to line 3 of the source code.

I know that this was never an error, just an annoyance. Thank you IBM for fixing this oversight.

 

This article was written for IBM i 7.6 TR1 and 7.5 TR7.

No comments:

Post a Comment

To prevent "comment spam" all comments are moderated.
Learn about this website's comments policy here.

Some people have reported that they cannot post a comment using certain computers and browsers. If this is you feel free to use the Contact Form to send me the comment and I will post it for you, please include the title of the post so I know which one to post the comment to.