You can do this:

evalr char = %triml(%editc(number:'X'): '0');

Though, I can't for the life of me understand why you'd want to strip out the decimal point. Now you're going to rely on the program that receives the variable to assume a certain number of decimal points -- so the number of decimal points has to be defined in two places, the one who creates the parm, and the one who receives the parm.

Wouldn't it make more sense to leave the decimal point in the code so the decimal places from the caller/callee don't have to match? Instead, they calculate the number of decimals in the parm based on the position of the decimal point? i.e. self-describing data.

It's also a lot easier for a human-being to read that way.

Adam West wrote:
HI I have a field that has to be sent over as character. It is numeric with many prices as 19.99, etc.
I want to send it as character ' 19999' for 7 pos. field.
I am looking for the neatest way to do in RPG.

This thread ...


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

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