Home All Groups Group Topic Archive Search About

COBOL Packed decimal converter to VB decimal

Author
10 Jan 2006 4:35 PM
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!

Author
10 Jan 2006 4:47 PM
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
Author
10 Jan 2006 5:01 PM
Patrice
Don't know but by Googling I found :
http://jymengant.ifrance.com/jymengant/jurassicfaq.html

It should provide a Java class that you could likely port to .NET...

--
Patrice

Show quoteHide quote
"Brian Henry" <nospam@nospam.com> a écrit dans le message de
news:uRgAWPgFGHA.1736@TK2MSFTNGP14.phx.gbl...
> 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!
>
>
Author
13 Jan 2006 11:02 PM
al jones
On Tue, 10 Jan 2006 11:35:13 -0500, Brian Henry wrote:

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