decimal field in printerfile

2505 pts.
Tags:
AS/400
I have a decimal field (amount field) defined as (15S 2)I am populating this field from a file field which is also of same attribute. I dont want leading Zeros to appear on this field so I used edtcde(1). Leading Zeros are suppressed. But it seems the field is taking much space than length 15(Value in the field is 50,000.00 but it took a space of 20 with blanks in the begining) and so overlapping with the next field. Why so? Any other editcode is there which can suppress leading zeros and want to show decimal point as well. Nothing more like dollar symbol or -ve sign required. Please assist

Answer Wiki

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

If the PRTF is internally defined in your program, you can rearrange the output specs so the Amount field is before the field that preceeds it. That way the other field will overlay the beginning of the Amount field.

Example:

Current Specs:

O    PriorField      25

O    Amount         40

======

Suggested:

O      Amount         40

O      PriorField      25

Discuss This Question: 6  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
  • TomLiotta
    A (15S 2) field with EDTCDE(1) should take up 20 positions. There will be 15 digits, plus a decimal point, plus four comma separators - 20 characters. You could use an edit code that doesn't include comma separators. -- Tom
    125,585 pointsBadges:
    report
  • ToddN2000
    You could rearrange the field print sequence to allow the overlap as mentioned above.The question you need to ask yourself is what is the largest amount value that exists for that field? You need to make sure if you do overlap, you do not overlay valid data. If you have the ability to make the programming changes, I assume you do if you can change the edit code, why not change the size of the field in the print file to your maximum data value size?.
    11,025 pointsBadges:
    report
  • gfprogrammer
    An edit code of 4 will only show the decimal point.  This will just add 1 extra position for the decimal making the output 16 positions.
    250 pointsBadges:
    report
  • philpl1jb
    15 - 2     1,234,567,890,123.45 If you know that you will not need a number that big then you might want to move this to a smaller field and print that field.  
    49,940 pointsBadges:
    report
  • TomLiotta
    If the PRTF is internally defined in your program, you can rearrange the output specs...   If the PRTF is externally described, you can also rearrange the output fields in a similar way. Generally, it's far better to have a PRTF be externally described.   Tom
    125,585 pointsBadges:
    report
  • philpl1jb
    Note: placing the fields on the output right to left will allow you to overlay some of the spaces from a long number field with the next field to the left but it will overlay these characters even if they contain digits.
    49,940 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