510 pts.
 Clear Leading ZERO’S
Hi,

I am having a numeric field which is used in KLIST.I need to remove the leading zero's for my numeric field.How i can do this.



Software/Hardware used:
AS400
ASKED: May 14, 2012  6:52 AM
UPDATED: May 25, 2012  7:41 AM

Answer Wiki:
Before moving to Decimal field you can suppress leading zeros in character field using below command. And, then you can convert the result into Decimal field. <b>EVALR WKCHAR = %TRIML(WKCHAR:'0') WKDEC = %DEC(WKCHAR:10:0)</b> Pradeep.
Last Wiki Answer Submitted:  May 14, 2012  12:51 pm  by  deepu9321   3,370 pts.
All Answer Wiki Contributors:  deepu9321   3,370 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


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


 

Are you moving the data to numeric field from a character variable?

Pradeep.

 3,370 pts.

 

Yes moving from a character variable to a numeric value

 510 pts.

 

Yes moving from a character variable to a numeric value

You can’t clear leading zeros from a numeric field. If you do, it’s not numeric any more.

If you need the zeros cleared, then don’t use a numeric field — use a character field.

Tom

 108,330 pts.