Page 1 of 1

Where to run code that includes Iconv/Oconv code in PX jobs

Posted: Tue Sep 21, 2010 5:35 am
by Marley777
Would like to put the code below in a transformer in a PX job, but it won't compile. Where do I need to place this code in a PX job?

Thanks

Oconv(Iconv(InLink.TheDate, "DMDY"), "D-YMD[4,2,2]")

Posted: Tue Sep 21, 2010 6:21 am
by wernerg_at
Hi,

as far as i know this is a server function and won't work in a PX transformer. possible workarounds are described in this thread:

viewtopic.php?t=135221&highlight=oconv

by the way i found a 6 year old developerworks post from ray, where he suggested the questioner to "roll his own one". :)

http://www.ibm.com/developerworks/forum ... &tstart=45

BR


Werner

Posted: Tue Sep 21, 2010 7:11 am
by chulett
There's no burning need for those functions in a PX job, as there are perfectly acceptable String/Date handling functions already available. You just need to 'convert' one to the other.

Posted: Tue Sep 21, 2010 7:46 am
by ArndW
BASIC Code wrote:Oconv(Iconv(InLink.TheDate, "DMDY"), "D-YMD[4,2,2]")
PX Transformer Code wrote:DateToString(StringToDate(InLink.TheDate,"%mm-%dd-%yyyy"),"%yyyy-%mm-%dd")

Posted: Tue Sep 21, 2010 8:00 am
by Marley777
Thanks Everyone. I'll roll one with this and let you know how it goes.