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 15:28:33
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
How do I convert COBOL Comp-3 packed to ASCII?
Divers
Thread ID:
00762419
Message ID:
00762419
Vues:
96
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?


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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform