Re: Packed Decimal
Posted in 1996
H. James Rader wrote:
>
> We have lots of data that we are trying to move with ftp from our
> mainframe to a unix box and then load with dbload. The great majority of
> the data fields are packed decimal. Does anyone have a down and dirty
> idea of how to handle this problem?
>
> H. James Rader "Computers in the future may weigh no
> more than 1.5 tons" - Popular Mechanics, 1949
Yeah, this is a lot of fun.
1) Packed fields are binary data.
2) With binary data you can't use your dd conv option. Data goes away.
3) Since you have to import your data in its native ebcdic format, you
cant
use dbload.
So, you're screwed right? Not really.
Option 1, write cobol programs which read in a record with packed fields
and
write out a record with the numeric data as strings and use dd to read
the
file and translate from ebcdic to ascii.
This will work, but for each file you have, you have to write a
separate
program. ;-)
Option 2, get ONLINE 7.2 There is a utility which is supposed to ship
with 7.2 to
support the data conversion for you.
OOPS! I'm sorry, INFORMIX hasn't shipped 7.2 yet! (And they had it at
last years
show! ;-)
Option 3. Write an esql/c for each file you need to convert. Convert
each record,
then slam it in to the database.
This will work, but you have to write one program for every file you
need to convert.
Option 4. Write a program which uses a meta database and from the
database
you open the input file, create the table , convert the data and insert
into
the table.
Now, I do happen to have some of the pieces ..... ;-)
-Mikey
[Packed / Zoned, its all COMP-3]