How to transform EBCDIC packed decimal into ASCII?

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
gmt_etldev
Premium Member
Premium Member
Posts: 7
Joined: Mon Dec 17, 2007 1:37 am
Location: Boston, MA

How to transform EBCDIC packed decimal into ASCII?

Post 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.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Aruna Gutti
Premium Member
Premium Member
Posts: 145
Joined: Fri Sep 21, 2007 9:35 am
Location: Boston

Post 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.
bcarlson
Premium Member
Premium Member
Posts: 772
Joined: Fri Oct 01, 2004 3:06 pm
Location: Minnesota

Post 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.
Post Reply