Page 1 of 1

EBCDIC to ASCII Conversion

Posted: Thu Aug 14, 2003 2:46 am
by viji
My source files are from mainframes and all are in EBCIDC format. Do i need to convert them to ASCII for using the file in datastage. If yes, is there support from datastage in doing so & how expensive is the operation (in terms of coding effort?). Will it have a performance issue?

Posted: Thu Aug 14, 2003 3:22 am
by roy
Hi,
you can use the DS Ascii() function in a transformer to do the conversion
OR
you could ask that the files will be supplied in ascii format which there are special utilities in MF that do just that.

Good Luck,

Roy R.

Posted: Thu Aug 14, 2003 6:14 am
by kai
To do so you could also use the Complex Flat File Stage. On the output page, general tab you can choose the data format being ASCII or EBCDIC.

Hope this helps.

Regards,
Kai

Posted: Thu Aug 14, 2003 6:34 am
by chulett
Don't know how familiar you are with dealing with EBCDIC stuff, but just in case... apologies if this is old news.

Only convert 'unpacked' fields to ASCII. If you have any packed fields (COMP-1 or COMP-3 fields, for example), they need to be handled separately and *not* converted. There are routines in the SDK for handling packed fields.

-craig

Posted: Thu Aug 14, 2003 9:27 am
by inter5566
Viji,

If your mainframe EBCDIC files are completely composed of character fields, then you should be able to just perform an ftp stage with mode set to ascii. Otherwise, you can follow Craigs advise and perform an ftp stage in binary mode into a transformer stage with output derivations of ascii(INPUT.VARNAME) or use the DS transforms SDK's for packed decimal, binary, or zoned numeric, all signed or unsigned. The trick to success of the ftp is:
1. turn on match data to metadata
2. binary mode
3. fixed width fields
4. may need to adjust line termination (none or DOS)
5. on the columns tab for the ftp make sure that the display column is filled in with the same value as width....VERY IMPORTANT...
(width and display should match the actual byte count of the mainframe field)

The rest is basic DS

Hope this helps,
Steve