Page 1 of 1

Help in building a simple parallel routine

Posted: Fri Dec 23, 2011 1:29 am
by vskr72
I need to build a simple routine to handle a logic like this. I went thru the option of creating a enw parallel routine. But, I am lost as to where I need to put this logic. There doesnt seem to be a place to add this code.

Code: Select all

If IsValid('date', ToTfm.AS_OF_DATE,"%yyyy%mm%dd") then StringTODate(ToTfm.AS_OF_DATE,"%yyyy%mm%dd") else SetNull()
Am I missing anything here. Can any one send me some instructions for it? Thank y ou.

Posted: Fri Dec 23, 2011 2:50 am
by ray.wurlod
You create and compile the routine external to DataStage. Preferably you also create and compile a main program with which to test it.

The "parallel routine" that you create within DataStage is not actually a routine - it is an interlude - a record of the existence, location and arguments of the actual routine executable.

Posted: Fri Dec 23, 2011 7:31 am
by chulett
Also understand that a parallel routine must be written in C++.

Re: Help in building a simple parallel routine

Posted: Fri Dec 23, 2011 9:13 am
by zulfi123786

Code: Select all

If IsValid('date', ToTfm.AS_OF_DATE,"%yyyy%mm%dd") then StringTODate(ToTfm.AS_OF_DATE,"%yyyy%mm%dd") else SetNull()
1. IsValid() in parallel doesnt take third argument !
2. Date is not a native data type for C
3. SetNull() which is an outband Null cant be passed to and from a parallel routine
4. The very simple single line statement of datastage would become bulky when you involve pointers for storing the arguments.