EBCDIC to ASCII Conversion

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
viji
Participant
Posts: 3
Joined: Thu Aug 14, 2003 2:41 am

EBCDIC to ASCII Conversion

Post 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?
roy
Participant
Posts: 2598
Joined: Wed Jul 30, 2003 2:05 am
Location: Israel

Post 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.
kai
Premium Member
Premium Member
Posts: 2
Joined: Thu Aug 14, 2003 7:22 am
Contact:

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

Post 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
inter5566
Premium Member
Premium Member
Posts: 57
Joined: Tue Jun 10, 2003 1:51 pm
Location: US - Midwest

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