• Subject: Re: RPGLE/400: Zoned Field becomes Packed !
  • From: Anton Gombkötö <Gombkoetoe@xxxxxxxxxx>
  • Date: Mon, 20 Mar 2000 11:51:13 +0100

>Mario Cardinale:
> i've a zoned field in a file, but when i compile the RPGLE that field
> becomes packed. Why ?

First: The file field stays zoned. If you have an external described file,
fields remain unchanged.

But: Packed is the preferred format for decimals. Even when you LIKE DEFINE
a field to a zoned one, it will be packed.

In such a case, you can force it to be zoned by coding an external described
data structure which uses the format of the file.

for example:

File MASTER has a zoned field AMOUNT.

Instead of

D XXAMOUNT       S                   LIKE(AMOUNT)

which leads to a zoned XXAMOUNT, you can use

D XXMASTER    E DS                EXTNAME(MASTER)

which will lead to a zoned XXAMOUNT and a lot of 7031-Warnings in the
compile listing, but who cares in these days.

The last way would be the explicit definition of a zoned field.

As a conclusion, i try to avoid zoned decimal fields.

This is a FAQ. If you are interested in more details, search the archives at
www.midrange.com , it was in the newsgroup too, so you can find it at
http://www.deja.com too.

+---
| This is the RPG/400 Mailing List!
| To submit a new message, send your mail to RPG400-L@midrange.com.
| To subscribe to this list send email to RPG400-L-SUB@midrange.com.
| To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---


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.