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?

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.

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.

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

Following

Share this item with your network: