packed & zoned both are used for numeric data types in rpg but if packed occupies 1 byte and zoned occupied 2 bytes then why don’t we use packed?

1485 pts.
Tags:
AS/400
RPG Data Fields
RPG/400
Storage capacity planning
packed & zoned both are used for numeric data types in rpg/400 but if packed occupies 1 byte and zoned occupies 2 bytes then why don't we use packed always considering system storage capacity?

Software/Hardware used:
AS/400

Answer Wiki

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

In my experience using packed decimal is good if you don’t interact with as400 from other plataforms.

I had troubles calling RPG programs from Java, transfers data over tcp that involves others operating systems and programming languages or managing data queues.

Regards

Discuss This Question: 1  Reply

 
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
    If you are using the values for computations, then packed-decimal is a much better choice. If you are using the values for display purposes such as a product identifier, then zoned-decimal might be better. In general, the RPG language is going to take extra time to convert zoned-decimal values to packed-decimal every time the program inputs (or outputs) a record if the field is used in any kind of calculation unless you code data structures to control it. It's not largely different sending zoned or packed fields to ASCII systems when fields may be negative, so it doesn't matter much which of those are used. It's often best to create a VIEW or LF that presents the value in a more platform-independent way. Given the storage capacities of reasonably current systems, there are almost always better ways to manage space than to use packed-decimal when zoned is more appropriate. However, there might be rare situations where it makes a difference. I'd be interested in knowing about one. 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