1,025 pts.
 AS400 – RPGLE
I wanted move Numeric Field to Character field. I am using Free format RPGLE Program. I have used %Char to do this operation. It is moving 2 to Character field, While trying to move 02 to Character field. I am expecting '02' in Character field How to achieve this in Free format RPGLE Program?

Software/Hardware used:
ASKED: November 19, 2009  8:02 AM
UPDATED: November 20, 2009  1:55 AM

Answer Wiki:
if the value is always positive integer CharFld = %editc( decFld : 'X'); otherwise perhaps $editw( MyFld : '0 . '); Phil
Last Wiki Answer Submitted:  November 19, 2009  9:25 am  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:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

use a data structure with the numeric field “redefined” as a character field …
move your numeric field to the data structure numeric field … then take the value
in the data structure character field …

D DS
D NUM 1 2 0
D CHAR 1 2

 405 pts.

 

that sould have been CharFld = %editw( MyFld : ’0 ‘;
Phil

 44,220 pts.