Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How do I convert COBOL Comp-3 packed to ASCII?
Message
 
 
À
06/03/2003 15:28:33
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00762419
Message ID:
00762447
Vues:
24
Hi Alex,

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

>How do I convert COBOL Comp-3 packed to ASCII?
>
>I am receiving a flat file that has a few bytes in COBOL COmp-3 packed format.
>
>I only need to read 6 bytes then unpack to convert to ASCII in 12 bytes.
>The first byte will contain a 01 or 02 that will tell me if the number that follows should be considered negative or positive. The number is in the next five bytes and will translate to a number with one decimal position.
>
>Samples:
>
>01 00 00 02 22 22
>02 00 00 03 33 33
>
>
>So, I understand the first byte. But how do I read/convert the number00022?
>
>I looked at Google and saw a few pages explaining ECBDIC but am no closer to a solution.
>Any clues from the old timers out here that remember this arcane stuff?
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform