Evaluate Weigh the pros and cons of technologies, products and projects you are considering.

EvalR solves problems with %EditC

Using %editc to convert a numeric to a string has always resulted in problems. This tip provides a workaround.

Trying to use %editc to convert a numeric to a string has always resulted in problems. If x is 9,2 and contains 5.38, then eval c=%editc(x:'Z') results in '5.3', which is very annoying. Here are a few solutions to try:

Use MOVE X C or, as I just stumbled across, use evalR C=%editc(X:'Z'). This seems to work with all edit codes and can be combined with %trim(), as in evalr c=%trim(%editr(x:'Z'))

==================================
MORE INFORMATION ON THIS TOPIC
==================================

The Best Web Links: tips, tutorials and more.

Visit the ITKnowledge Exchange and get answers to your developing questions fast.

Ask the Experts yourself: Our application development gurus are waiting to answer your programming questions.


Dig Deeper on iSeries application development tools

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchDataCenter

Close