Clear Leading ZERO’S

510 pts.
Tags:
AS/400
AS400 RPGLE
Hi,

I am having a numeric field which is used in KLIST.I need to remove the leading zero's for my numeric field.How i can do this.



Software/Hardware used:
AS400

Answer Wiki

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

Before moving to Decimal field you can suppress leading zeros in character field using below command. And, then you can convert the result into Decimal field.

<b>EVALR WKCHAR = %TRIML(WKCHAR:’0′)
WKDEC = %DEC(WKCHAR:10:0)</b>

Pradeep.

Discuss This Question: 3  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
  • deepu9321
    Are you moving the data to numeric field from a character variable? Pradeep.
    3,650 pointsBadges:
    report
  • 22917
    Yes moving from a character variable to a numeric value
    510 pointsBadges:
    report
  • TomLiotta
    Yes moving from a character variable to a numeric value You can't clear leading zeros from a numeric field. If you do, it's not numeric any more. If you need the zeros cleared, then don't use a numeric field -- use a character field. Tom
    125,585 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