Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Converting Packed/Decimal numeric from mainframe to ASCII text.

Re: Converting Packed/Decimal numeric from mainframe to ASCII text.

From: Mark D Powell <Mark.Powell_at_eds.com>
Date: 5 Nov 2002 07:01:27 -0800
Message-ID: <2687bb95.0211050701.417c3b5d@posting.google.com>


"Peter van Rijn" <p.vanrijnREMOVE_at_THISzhew.nl> wrote in message news:<usctg6ja937i6d_at_corp.supernews.com>...
> Use the Unix "dd" command with "conv=ascii" option.
> Refer to the Unix Manual pages for further details.
>
> Peter
>
>
> "Joe" <RappaJ_at_nycha.nyc.gov> schreef in bericht
> news:ab8e8633.0211040520.599af40c_at_posting.google.com...
> > Hi,
> >
> > Does anyone know of a way that I can convert data from the mainframe
> > to ASCII fixed? I am working on an Oracle 8.1.7 database on a UNIX
> > platform and need the data converted so I can load it into Oracle via
> > SQLLDR.
> >
> > Any help is appreciated.
> >
> > Thank you,
> > Joe

I do not think dd can be used on the file if numberic fields are in packed decimal format since this is not a valid EBCDIC character to be translated and some packed bytes may translate. Packed (mainframe) example: character 12345 would be hex F1F2F3F4F5 and would be stored as (hex) 12,34,5F in three bytes. The 5F could be a 5C or 5D if the field was signed where C = positive and D = negative. I believe a straight ASCII conversion would destroy the value.

The sqlldr program recognizes packed decimal but I am not sure this would be available on a non-mainframe machine. The simple way to handle this is to extract the mainframe data into character format, ftp this accross performing the ascii conversion, and then reload this data and convert the character digits into a number when stored.

If you are stuck with binary data files on a non-mainframe you can write C code to unpack the fields on UNIX or Windows platforms.

HTH -- Mark D Powell -- Received on Tue Nov 05 2002 - 09:01:27 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US