converting a numeric to character

0 pts.
Tags:
RPG
RPGLE
How do I get a number into char format so I can manipulate the string
ASKED: October 25, 2006  5:21 AM
UPDATED: June 18, 2008  11:40 PM

Answer Wiki

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

Hi

In which language? In RPG IV/ILE you would use the edit code built in function:

Eval String = %EditC(Numeric : ‘X’)

Edit code “X” gives you a straight numeric conversion without commas, blanks, etc.

In CL you simply use the CHGVAR command:

CHGVAR VAR(&STRING) VALUE(&NUMERIC)

All the best

Jonathan

Discuss This Question: 2  Replies

 
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
  • Grinchly
    In RPGIII you can use a simple move. MOVE Num Alpha IN /Free you can use the %CHAR bif Alpha = %char(num); You can also use a data structure Convert DS Num 1 2S 0 Alpha 1 2A
    0 pointsBadges:
    report
  • Ricksmith
    Be aware that if you use the %CHAR bif, leading zeros will be dropped.
    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