Moving zeros to preceeding empty spaces on numeric field

120 pts.
Tags:
editw
Hi I am facing issue with my rpgle free format code. I have a numeric field named myNum of length 7,0 and it stores the value 12345 in it. Now I need to move it to the character field named myChar of length 7 and the result to be displayed as '0012345'. I have tried this with %editW keyword but I am getting error RNF7059 again and again. Could any one please help me in getting out of this problem. Any sample code provided would be really helpful. Thanks, Vivek Sharma

Software/Hardware used:
RPGLE

Answer Wiki

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

Discuss This Question: 4  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
  • BigKat
    as long as myNum is positive:
    myChar = %editc(myNum:'X');
    8,200 pointsBadges:
    report
  • BigKat
    you wouldn't get the '-' sign if it was negative
    8,200 pointsBadges:
    report
  • TomLiotta
    ...and the result to be displayed as '0012345'. Just use %ABS() to assign the value to a zoned-decimal field that OVERLAYs your character field. Tom
    125,585 pointsBadges:
    report
  • VivekSharma
    Hi Thanks a ton for all your help. My question has been answered. - Vivek
    120 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