× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Bob,

Looking at the compile listing, The field in
question is defined as 9s 0 everywhere until the global field references
section when it shows as P(9,0).
Has anyone seen this before?


Working as designed, provided the field is not also defined in a DS
somewhere.

Numeric fields from externally described files will be in packed format in
the program storage whether zoned or packed in the DDS, unless you use a
DS. The field gets converted to/from packed format as part of the field
movement from the record buffer.

The reason for this is because, as I understand it, (at least in the CISC
days) it optimized the usage of the field during execution eg, when you
performed calculations with it. Although the CPU had instructions for adding
packed to zoned or vice versa, it was more efficient to always use a single
type. On the 38/400 this was packed. On the 34/36, the exact opposite was
true and all calculations were done on zoned fields, even if defined as
packed in the record layout.

In fact, this leads to hoops you have to jump through when calling between
RPG II and RPG/400 or ILE programs and passing numerics via PLIST/PARM.

I don't know if the RISC machines are more efficient using packed, but IBM
can't just change the compiler behavior now since would impact existing
programs if they got recompiled.

Doug

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.