Page 1 of 1

How to transform EBCDIC packed decimal into ASCII?

Posted: Sun Feb 03, 2008 7:50 am
by gmt_etldev
I tried both Sequencial and Complex Flat File stage to transform EBCDIC file into ASCII file. It works well for transforming char. But it will always get import error when transforming packed decimal.

For example, the packed decimal 27 0f in the EBCDIC file is supposed to be transformed into decimal 270 in ASCII. But I got the log below:

Field "col1" has import error and no default value; data: {' 0f}, at offset: 0

Is there something wrong when importing the file? (' is the ASCII character for 27). I have already set the character set to EBCDIC.

Posted: Sun Feb 03, 2008 8:10 am
by chulett
Packed is packed and is neither ASCII nor EBCDIC. So while you do indeed need to convert character data as you've noted, packed fields need no such thing, and any 'conversion' will destroy them. You simply need to 'unpack' them.

Now, I haven't used the CFF stage so can't you specific advice there but I'm sure others can. I know in Server there are sdk routines that unpack the various flavors of packed fields, not sure about PX though. So while I don't have alot of help for you here, mostly just wanted to make sure you knew what approach you needed to take.

Posted: Thu Feb 07, 2008 11:47 am
by Aruna Gutti
What is the Data Style or Data Format specification for your input file ? Where is your input file coming from ?

Usually this is how I define my CFF input source from Mainframe.

Character set : EBCDIC

Data Style / Data format ( depending on DataStage version : Binary

Regards,

Aruna.

Posted: Thu Feb 07, 2008 4:04 pm
by bcarlson
There have been other postings about converting EBCDIC to ASCII, and how to deal with numeric data.

Here are a couple of topics to look at:

How to convert the signed decimal

Mainframe MVS File to SF/CFF stage. Values Incorrect

Hope this helps.

Brad.