Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How do I convert COBOL Comp-3 packed to ASCII?
Message
De
06/03/2003 16:28:58
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00762419
Message ID:
00762462
Vues:
28
>I don't know what format it's but it's not Cobol Comp-3 packed format. See http://digilander.libero.it/foxes/Packed_Decimal.htm

I understand that now :)
That is one of the pages I got from Google today.

I called the creator of the data and they shed some light. They are restricting numbers and "simplifying" it a bit. The amounts are in dollars, and I misunderstood, as they tell me will have two decimals.
02 00 00 00 31 05
The above example in Hex means positive (the '02') then the next five bytes the amount with two decimals. As they just told me on the phone, there is no conversion required. This example means $31.05

The 5-byte compressed format from their mainframe means I can hold 10 bytes uncompressed. That is 99,999,999.99 as the max amount the system supports (commas and decimal point added for clarity).

My job now is to translate each string as it comes into a dollar amount I can use. So, I guess I would have to read byte-by-byte, from left to right with CHR() and use the number returned straight as it is.


Alex Feldstein, MCP, Microsoft MVP
VFP Tips: English - Spanish
Website - Blog - Photo Gallery


"Once again, we come to the Holiday Season, a deeply religious time that each of us observes, in his own way, by going to the mall of his choice." -- Dave Barry
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform