Numeric fields in AS/400

365 pts.
Tags:
AS/400 administration
AS/400 numeric fields
Display File
I have a numeric field 5,2 in a display file. when i am entering values i have blanks in between two numeric digits. the program is considering these blanks as zero. I hvae to avoid this, please let me know the way.
ASKED: December 22, 2008  12:26 PM
UPDATED: December 29, 2008  1:41 PM

Answer Wiki

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

One method
– change field in DSPF to char
– check the value in your program
– fix or display error if spaces exist between the digits.
phil

Thanks Phil.

I have used VALNUM in DSPF and resolved this issue.. Thanks again

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
  • graybeard52
    As suggested, redefine the field as char. In the RPG pgm, you can use %dec function. numField = %dec(charField:5:2) The %dec ignores any blanks and aligns the decimal point automagically.
    3,115 pointsBadges:
    report
  • philpl1jb
    %Dec will create a number as 1---5.00 becomes 15.00 (--- are blanks) However, this is a hanging chad type problem, did the user intend to enter 1.00 or 15.00? So what I do is inspect the entry and if it looks bad redisplay it as an error and make the user fix it, after all they are still sitting there and should know what they intended. Phil
    48,575 pointsBadges:
    report
  • philpl1jb
    VALNUM - Thanks, there's always more to learn. I've got atleast one place in my code that needs that code Phil
    48,575 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