How to call a sdk category routine in the transformer stage

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
sjordery
Premium Member
Premium Member
Posts: 202
Joined: Thu Jun 08, 2006 5:58 am

How to call a sdk category routine in the transformer stage

Post 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.
nick.bond
Charter Member
Charter Member
Posts: 230
Joined: Thu Jan 15, 2004 12:00 pm
Location: London

Post 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.
Regards,

Nick.
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post 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.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
nick.bond
Charter Member
Charter Member
Posts: 230
Joined: Thu Jan 15, 2004 12:00 pm
Location: London

Post 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.
Regards,

Nick.
sjordery
Premium Member
Premium Member
Posts: 202
Joined: Thu Jun 08, 2006 5:58 am

Post 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.
nick.bond
Charter Member
Charter Member
Posts: 230
Joined: Thu Jan 15, 2004 12:00 pm
Location: London

Post 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.
Regards,

Nick.
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post 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.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
Post Reply