EBCDIC to ASCII Conversion

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
patonp
Premium Member
Premium Member
Posts: 110
Joined: Thu Mar 11, 2004 7:59 am
Location: Toronto, ON

EBCDIC to ASCII Conversion

Post by patonp »

Hi All,

I'd like to convert a string from EBCDIC to ASCII within a Transformer stage. If I were developing this code in Server Edition, I'd simply use the ASCII() function. How can I do the same thing in Parallel Edition?

Thanks!

Peter
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

CFF stage is built effeciently to handle this type of data. If you able to provide the layout or the copybook, it will be easiest for you.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
patonp
Premium Member
Premium Member
Posts: 110
Joined: Thu Mar 11, 2004 7:59 am
Location: Toronto, ON

Post by patonp »

In my particular case, using a CFF stage is not the most suitable option.

Any suggestions as to how I can perform the conversion within a transformer?

Thanks,

Peter
gsherry1
Charter Member
Charter Member
Posts: 173
Joined: Fri Jun 17, 2005 8:31 am
Location: Canada

Post by gsherry1 »

patonp wrote: Any suggestions as to how I can perform the conversion within a transformer?
From the transformer you can call an parallel routine that you can write in C that does a simple efficient translation from EBCDIC to ASCII. A simple while loop and a couple arrays would do. The advantage of doing this is you can call the function conditionally for certain fields based on other stage variable logic.

The Sequential flat file also has EBCDIC parsing abilities that rival the CFF.

Definitely the derivation functions for handling EBCDIC seem to have dissapeared. If you require some conditioinal application of EBCDIC to ASCII translation you might want to employ a strategy similar to what's suggested in this link:

viewtopic.php?t=104116&highlight=

Greg
ukyrvd
Premium Member
Premium Member
Posts: 73
Joined: Thu Feb 10, 2005 10:59 am

Re: EBCDIC to ASCII Conversion

Post by ukyrvd »

patonp wrote:If I were developing this code in Server Edition, I'd simply use the ASCII() function. How can I do the same thing in Parallel Edition?
parallel transform doesnt have ASCII function ..but the BASIC transform does. The simplest solution would be , if you can afford the performance loss, using this stage in your parallel job
thank you
- prasad
patonp
Premium Member
Premium Member
Posts: 110
Joined: Thu Mar 11, 2004 7:59 am
Location: Toronto, ON

Post by patonp »

you can call an parallel routine that you can write in C that does a simple efficient translation from EBCDIC to ASCII
So does this mean that there is no functionality within the parallel toolset to perform this type of conversion after the data has been read from a file?
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

That is correct, unless you convert the data while reading the PX engine doesn't have builtin functionality to perform that conversion.
patonp
Premium Member
Premium Member
Posts: 110
Joined: Thu Mar 11, 2004 7:59 am
Location: Toronto, ON

Post by patonp »

Thanks for your help everyone!
Post Reply