Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How do I convert COBOL Comp-3 packed to ASCII?
Message
From
06/03/2003 15:28:33
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
How do I convert COBOL Comp-3 packed to ASCII?
Miscellaneous
Thread ID:
00762419
Message ID:
00762419
Views:
97
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
Next
Reply
Map
View

Click here to load this message in the networking platform