Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
COBOL Field Codes
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00477996
Message ID:
00478563
Vues:
20
Kevin,

It looks like you've already got the basic answers here. But there are a couple of other things to be aware of.

First thing is to look for a modifier that may follow a numeric PICTURE clause, for example COMP or COMP-3 (short for COMPUTATIONAL and COMPUTATIONAL-3). This doesn't change the precision of the number, but does affect the physical storage allocated. Also, the physical size and even the data type may vary depending on whose version of COBOL you're using. I'm thinking mainframes here, where IBM is different that Unisys, for example.

This is from long-time-ago memory here, so cut me a little slack, but in general it's like this:

On IBM mainframes, COMP-3 is packed decimal format, which means each digit occupies one nibble (half-byte), with a slack nibble added to make the overall field size end on a byte boundary. So, 9(3)V99 is five bytes but 9(3)V99 COMP-3 is three bytes. Both can hold values up to 999.99. On IBM, COMP is actually binary, and fixed sizes are allocated in such a way that 9(2) COMP and 9(4) COMP may actually be the same physical storage size (there's a set of binary field sizes, but I don't remember where the boundaries are).

On Unisys mainframes, COMP means packed decimal. COMP-3 is superfluous and means the same thing as COMP. Unisys allows numeric fields to end on half-byte boundaries, so you don't have any slack nibbles like you do on IBM.

There are other differences, too, such as where the sign is located on signed numbers. And of course, if the data is on a mainframe it's probably EBCDIC, not ASCII like on a PC.

HTH,
-Rick



>My COBOL is a bit rusty.
>
>What size are these fields in FoxPro:
>
>PIC 9(13)
>PIC -(08)9.99
>PIC 9(09)V99
>
>Thanks
Rick Borup, MCSD

recursion (rE-kur'-shun) n.
  see recursion.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform