Page 1 of 1

How to call a sdk category routine in the transformer stage

Posted: Thu Apr 26, 2007 2:20 am
by sjordery
Hi all,

Can anybody suggest me how to call a sdk category routine in the column derivation stage of the transformer.

For example in the date catagory of sdk there is a routine called DateGenericToTimeStamp.I want to use this routine in the derivation stage.

Posted: Thu Apr 26, 2007 3:57 am
by nick.bond
Thats a strange one. For some reason you see that routine. It must be something to do with the way it was compiled because it is a routine used by the transforms.

If you really want to use this one then just take a copy of it, rename to your own version and compile it. You will then see it in the drop down list for DS Transforms when you right click in the column derivation.

Posted: Thu Apr 26, 2007 6:57 am
by DSguru2B
Is'nt that a server routine? If your looking forward to using it in a px transformer, then dont. Its not available for px transformer. You will have to either use a server job or a basic transformer in a px job if you want to use that routine. But there are px transform functions that can do the same thing what the sdk routine is doing.

Posted: Thu Apr 26, 2007 7:38 am
by nick.bond
Once again I was ansering in Server mode :oops:

The routine can't be seen in server transformers which is still curious.

Posted: Thu Apr 26, 2007 8:02 am
by sjordery
My requeirement is like this

my input data for a particular column is like 02-feb-2007 its date-time data type.

I want the out put in 20070202 format
So can I use that iconv or oconv function in the parallel extender or is there any other method for this please suggest.

Posted: Thu Apr 26, 2007 8:18 am
by nick.bond
sjordery wrote:My requeirement is like this

my input data for a particular column is like 02-feb-2007 its date-time data type.

I want the out put in 20070202 format
So can I use that iconv or oconv function in the parallel extender or is there any other method for this please suggest.

If your column is of type date-time it is not in the format 02-feb-2007, the format is merly how it is displayed to you, it is in an internal date-time format. I don't have EE with me but you need to look at the Type Conversion functions. There will be one like DateToString which you pass in the date field, specifying the format you want the string to be in, eg. %yyyy%mm%dd, and map this derivation to a varchar of char field and you should get what you want. It can take a bit of playing to find the correct function and syntax which I can't help with more without somewhere to test it. (One hint is that when you pull up the function in Designer, you need to remove the '[' from the format part.

Posted: Thu Apr 26, 2007 8:19 am
by DSguru2B
No need to slow down your job by using a basic transformer just to use ICONV/OCONV. Read your date as varchar and inside a px transformer use the following derivation.

Code: Select all

StringToDate(in.Date, "%dd-%mmm-%yyyy")
In the output stage, go to the column's extended properties and change the date format from default %yyyy-%mm-%dd to %yyyy%mm%dd.