Page 1 of 1

EBCDIC to ASCII Conversion

Posted: Thu Oct 12, 2006 6:43 am
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

Posted: Thu Oct 12, 2006 7:21 am
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.

Posted: Thu Oct 12, 2006 7:51 am
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

Posted: Thu Oct 12, 2006 9:20 am
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

Re: EBCDIC to ASCII Conversion

Posted: Thu Oct 12, 2006 10:08 am
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

Posted: Fri Oct 13, 2006 8:07 am
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?

Posted: Fri Oct 13, 2006 8:15 am
by ArndW
That is correct, unless you convert the data while reading the PX engine doesn't have builtin functionality to perform that conversion.

Posted: Fri Oct 13, 2006 10:01 am
by patonp
Thanks for your help everyone!