As I recall, it has to do with RPG's field mapping that occurs during file I/O. With file I/O, each field gets copied one at a time into global variables, so that if a field name is specified in multiple files, they always map to the same storage location. Now, I believe that RPG prefers to work with packed decimal values, so by default these global variables are packed...

I believe that the only way to guarantee that these file fields do not get their type changed is to read and write to data-structures.

Eric

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx]On Behalf Of Bob P. Roche
Sent: Wednesday, October 17, 2007 4:29 PM
To: RPG programming on the AS400 / iSeries
Subject: Zoned fields showing as packed


A co-worker had a problem, that I haven't seen before, maybe there is a
PTF for it. He has a file with a field defined as 9s 0, we can verify it
in several places. When he tries to use that field in a prototyped call ,
also defined as 9s 0, he get a compile error - The type and attributes of
the parameter do not match those of the prototype. RNF7535. looking at the
source everything is fine. 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? For now he added CONST to the parm, The value
is not going to be changed so this converts it under the covers, but it
should work without that.

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.