Zoned decimal in a physical file

210 pts.
Tags:
AS/400
Physical File
Hello all, I have a decimal field in a physical file say amount 15S2. By default when we enter value in that field all leading zeroes are not shown in PF. For example suppose I enter 00025.33 into the amount filed. It will be shown as 25.33 in PF. I want it to be 0000000000025.33 in PF. Is there any way I can do this? Any help is appreciated
1

Answer Wiki

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

Simple answer

It does not matter how it is stored in the PF. It could be Packed Decimal, or Signed Decimal.

When you “show” it you need to use an EDIT CODE or EDIT WORD.

see this link

http://publib.boulder.ibm.com/iseries/v5r2/ic2924/books/c0925083202.htm

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.
  • philpl1jb

    In the Physical File it's 0000000000025.33

    But Shown? How do you see the value, that's what will affect the appearance. Are you using some Query tool or program to see the value.

    54,090 pointsBadges:
    report
  • ToddN2000
    How are you viewing the file? Are you doing a DSPPFM or using a query whit may format it to drop the leading zeros?
    127,650 pointsBadges:
    report
  • TheRealRaven
    Unless you are using DSPPFM to view the data member or you're using debug to see a DS that was populated by an I/O statement or some similar method, how do you know what the data looks like in the file?

    The storage format of data in a file is not likely to be related to how data looks when a program prints or displays the data. If your data really is stored in a file in the way that you describe, then it's not a zoned-decimal field; it's a character field. What you showed ("25.33") wouldn't be valid zoned-decimal data and would cause program errors. (The immediate problem is that there is no decimal point stored in zoned-decimal fields. That's a worse problem than having blanks in there.)

    So, exactly how do you know what's actually in the file?
    33,000 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.

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

Following

Share this item with your network: