To begin with, I am not looking for just a solution to fix this error message. I would be far more appreciative of being directed to documentation explaining this error than a solution to the code problem. I need to understand WHY this is happening because I cannot find any documentation which explains what is causing this error. I'm relatively new to RPG (less than 2 years) so I'm at a reasonable level of ignorance on this.
I am working on some legacy RPG code which was recompiled in October, 2017. This code has been in place since 2013.
My issue is that my users have recently (within the past 3-4 months) begun to get decimal data errors reported on this line of code:
C EvalR NewValueA = %char(NewValue)
The dumps from the error message shows that NewValue is empty. Not 0, just empty. In my experience with other languages, that's a NULL. None of my resources (including Google) give any indication how NULL is handled by %char() in RPGLE. It would be easy to assume that %char() doesn't handle NULL gracefully and move on, but that's hard to justify in a code review.
NewValue is defined as 7 0 decimal. NewValueA is an 8 character char.
Thanks in advance to all who have productive comments to offer.