By default, data structures in RPG are initialized to blanks. Even if they contain numbers, they are initialized to blanks! A VARLEN field (which is called VARYING in RPG) contains a two-byte prefix that's used to keep track of the length of the field. When the first two bytes of that field are set to blanks (i.e. x'4040') that effectively set the length of the field to 16448 (16448 decimal = 4040 hex)

Since your field is defined as 450 long, you can't set it's length to 16448 -- and that's why you get the RNX0115.

The fix? change the initial values in your DS to something besides blanks -- or try putting some data into the DS before doing the comparison.


tim wrote:
I am trying the following code and getting error RNQ0115. The value in both
fields is blank. Can someone shed some light as to why?



DDS

CCLONOTE 450 TEXT('CLOSING NOTE')
COLHDG('CLOSING NOTE')
ALIAS(CLOSING_NOTE)
VARLEN(75)


RPG

D mast E DS ExtName(mast)
d cm_b ds likeds(mast )
d cm_a ds likeds(mast )


/free
*inlr = *on;

if cm_b.caltnote <> cm_a.caltnote;

endif;


This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2019 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].