Is it possible to have a variable expression in RPG?
For example I can do the following:
Result = %Dec(5+2*2: 10: 3);
I want to do the following:
Equation = '5+2*2';
Result = %Dec(%Trim(Equation): 10: 3);
This fails with the following error "A character representation of a numeric value is in error (C G D F)." The string is being converted to a numeric value instead of being solved.
Any ideas on how to accomplish this?