EVAL FIELDC = %EDITC(FIELDN : 'X') <-- use appropriate edit code for your purpose
Phil
////////
The X edit code ensures a hexadecimal F sign for positive fields and a hexadecimal D sign for negative fields. However, because the system does this, you normally do not have to specify this code. Leading zeros are not suppressed. <b>You can use %EDITC with the X edit code to convert a number to character with leading zeros. However, be aware that negative numbers can produce unexpected results; for example, %EDITC(-00123:'X') will give the result '0012L'.</b>
Another method is
Eval FieldC = %Char(FieldN)
In this case leading zeros are suppressed and remember that you can use EVALR to right adjust (Move).
Wilson
--------------
Excellent point Wilson.
You've got all the edit codes, edit words, and %Char to use with EVAL and EVALR.
Phil
Last Wiki Answer Submitted: October 2, 2009 3:02 pm by WilsonAlano2,385 pts.
If you live outside the United States, by submitting your email address you consent to having your personal data transferred to and processed in the United States.
Thanks for your help guys.
NeilD
EVAL Char_Field = %Char(Num_Field) is the best way of assigning Character to numeric value.
In Somecase you may like to replace spaces with zeros by setting numeric value in right side. Use following in such cases….
EVALr Char_Field = %Char(Num_Field)
Eval Char_Field = %Xlate(‘ ‘:’0′:Char_Field)