numeric to text in RPG III

5 pts.
Tags:
RPG
RPG III
I have 3 numeric fields that I want to put together into one text string with leading zeros removed, like below: x=17 y=100 z=23 desired result: 17,100,18 as a text string How can I do this in RPG III? Thanks

Answer Wiki

Thanks. We'll let you know when a new response is added.

Hi,

You’ll need to look at using the CAT operation code – something like this :-

define X$ as character version of X
define Y$ as character version of Y
define Z$ as character version of Z

MOVE X X$
MOVE Y Y$
MOVE Z Z$

X$ CAT Y$ TEMP
TEMP CAT Z$ RESULT$

If you need to remove the leading zeros, then you need to look at using CHECK and SUBST

Regards,

Martin Gilbert.

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • MelissaH
    Thanks!!
    0 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following