Does anyone know of or know how to convert a COBOL packed decimal in a text
file to a decimal that .NET can work with? we are importing Old COBOL data
files that have packed data in them and need to convert it to a form we can
use. thanks!
The other answers to the side, if you have the source of the original COBOL
program, you'll also need to know the packing used. If memory serves me
correctly there were comp-1, -2 and -3. One was actually binary of word
length. Packed-2, again if memory serves correctly were the digits split
between the high and low order half of an 8 bit word. Thus What was (oh,
ebcdic, where art thow?) the 'Number' 78251 (F7 F8 F2 F5 F1) would have
been split into pair and packed as 's7 82 51' where s is the sign bit.
As a pointer you might want to take a look at
http://www.discinterchange.com/TechTalk_COBOL_comp_.html. //al
((I realize this doesn't answer your question, but it might suggest that
you need to look more closely at the data - rather than to just suggest
'packed'.))