converting numeric field to a character field and show leading zeros

30 pts.
Tags:
iSeries RPG programming
RPG
RPGLE
RPGLE Program
I am using %char to convert a numeric 9 pos field to character for use in a larger out put field. My code looks basically like eval labelout - "4J'+lpart+%char(lexpire)+%char(lserl) Where lexpire and lserl are used in the labelout field, I need the leading zeros to show. Right now, they are being inserted with blanks. How do I get this command to keep the leading zeros to show in my labelout field?
ASKED: February 18, 2009  3:27 PM
UPDATED: February 18, 2009  5:37 PM

Answer Wiki

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

Use %EDITC instead
+%EDITC(lserl:’X')
This assumes that lserl has zero decimal positions and is unsigned.

Discuss This Question:  

 
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

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