|
> RPG program compile listing shows the file with > some zoned fields like VNTIME 11 16 0 > but the list of fields at bottom of compile listing have > VNTIME P(6.0) Hmmm... I'm surprised that you haven't run into this before. Every numeric field defaults to packed unless you explicitly tell it otherwise. An easy way to tell it to use the same settings as the file is to declare an external data structure... > Why? same in both V5r1 and V5r2 It's always worked this way... all the way back to RPG III on the S/38. Every release of RPG III or RPG IV works this way. As I recall, there were two reasons for this. The first was that the machines were optimized for packed decimal back in the S/38 days. The second was that you're allowed to have fields be read in from many different files -- by forcing them all to use the same data type (packed) they don't conflict. For example, let's say you store the field "PRICE" as 9P 2 in your PF. In your display file you have the same field name "PRICE", but it has to be zoned (9S 2) because packed is not human readable and therefore doesn't work well on a display. Since RPG converts the fields from both files to packed for you, you can simply READ the PF, and EXFMT the display. You don't have to rename the fields to avoid a data type conflict, and you don't have to explictly move from one to the other. RPG makes them all consistent by converting them to packed. At any rate, none of this is new. I remember doing this on one of the first releases of OS/400 -- having to force my RPG III variables to be zoned with a data structure. It certainly isn't going to change now, as that would break compatibility. Here's a link to a previous discussion about this in the archives. You might find that discussion enlightening... http://archive.midrange.com/rpg400-l/200202/threads.html#00103
As an Amazon Associate we earn from qualifying purchases.
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.