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

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
Marley777
Premium Member
Premium Member
Posts: 316
Joined: Tue Jan 27, 2004 3:26 pm

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

Post 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]")
wernerg_at
Premium Member
Premium Member
Posts: 30
Joined: Thu Jan 14, 2010 5:46 am
Location: Austria

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

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post 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")
Marley777
Premium Member
Premium Member
Posts: 316
Joined: Tue Jan 27, 2004 3:26 pm

Post by Marley777 »

Thanks Everyone. I'll roll one with this and let you know how it goes.
Post Reply