COBOL Packed decimal converter to VB decimal

B

Brian Henry

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!
 
C

Cor Ligthert [MVP]

Brian,

The first thing you have to know is on what computer the Cobol files are
created without conversion.

In past there was for every computer almost another format for this.

(It is mostly used related to IBM mainframes/midis, however Microsoft and
others has as well made a compatible compilers where those things could be
used on a PC)

Cor
 
A

al jones

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'.))
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top