140 pts.
 rpg/400
please advice me how to convert numeric field to character field in rpgile.

Software/Hardware used:
ASKED: January 5, 2009  3:14 PM
UPDATED: January 7, 2009  4:30 PM

Answer Wiki:
EVAL charFld = %EDITC(numFld : 'X');
Last Wiki Answer Submitted:  January 5, 2009  4:42 pm  by  philpl1jb   44,220 pts.
All Answer Wiki Contributors:  philpl1jb   44,220 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


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


 

DINVAM 68 80
C EVAL INVAM = %EDITC(APCINA:’X')

APCINA is numeric field.

please check the above code. i need to get decimal positions to the resultatnt field INVAM but it
given value without any decimal position.

 140 pts.

 

Right ‘X’ is an RPG Edit Code – like you would would use on printer file or Display file
so you could use ’3′ – no leading zeros no sign no comma’s
‘P’ – no leading zeros left – sign no comma’s
Phil

 44,220 pts.

 

i am writing INVAM to flat file. in flat file i am not getting any decimal positions…

 140 pts.

 

DINVAM 68 80
C EVAL INVAM = %EDITC(APCINA:’3′)
INVAM is 13 long,
our edit codes assume that APCINA is
something like 12 2 if APCINA is wider it will push the decimal out of INVAM

If APCINA has 0 decimals and is short enough you might use something like

C EVAL INVAM = %trim(%EDITC(APCINA:’3′)) +’.00′

Phil

 44,220 pts.

 

by using %CHAR building function

 10 pts.