5 pts.
 leading zeros on numeric
In RPG how can I have a numeric field that keeps leading zeros?

Software/Hardware used:
ISeries, RPG
ASKED: April 1, 2010  12:58 PM
UPDATED: April 2, 2010  1:19 AM

Answer Wiki:
I would say : why not use an edit word, or the %EDITW() function ? You could also defined your own edit code. Could you give us a sample of what you want to do ? Thx
Last Wiki Answer Submitted:  April 1, 2010  1:06 pm  by  BillyBelgium   190 pts.
All Answer Wiki Contributors:  BillyBelgium   190 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

%editc(number:’X')

 1,130 pts.

 

Since you can’t stop a numeric field from having leading zeros when those positions are zero, I guess we have to assume that the question is about the result of converting a numeric value to a character value, either by assignment to a character field or by printing or displaying the value. The %editx() builtin functions can help for assignments. And edit codes or edit words can help for print or display.

An explanation of what is meant by “have a numeric field that keeps leading zeros” would be helpful.

Tom

 108,260 pts.

 

Need your input – what are you trying to do and are you actually using RPG or RPGLE?

 44,190 pts.