Page 1 of 1

Transformer logic

Posted: Thu Mar 08, 2007 4:23 pm
by kashif007
Hi Guys

I have to do a some sort of validation process in the datastage transformer. The logic to be used is=>

If the input value for one particular column is not "Numeric" then don't move it to the next level or stage. The data which is Numeric is only moved further. I am reading the Data as Varchar. Can anyone suggest what logic I use to produce this kind of output using the constraint of transformer.

Thanks

Re: Transformer logic

Posted: Thu Mar 08, 2007 4:55 pm
by Yuan_Edward
The function IsValid can be used to check if a value is numeric, I am using Transformer stage variable to keep the result and then it can be used in the constraint condition.
kashif007 wrote:Hi Guys

I have to do a some sort of validation process in the datastage transformer. The logic to be used is=>

If the input value for one particular column is not "Numeric" then don't move it to the next level or stage. The data which is Numeric is only moved further. I am reading the Data as Varchar. Can anyone suggest what logic I use to produce this kind of output using the constraint of transformer.

Thanks

Posted: Thu Mar 08, 2007 5:17 pm
by kashif007
That is exactly what I need but I am not sure how you did that. I am using a logic

IsValid("Numeric", DSLinkname)

Please correct me. I am not getting the right stuff with this logic.

Posted: Thu Mar 08, 2007 5:29 pm
by mansoor_nb
you can also use the NUM function to check whether the source column is numeric or not.It will return 1 if the source column is numeric otherwise it will return 0

Posted: Thu Mar 08, 2007 5:33 pm
by kashif007
Thanks Mansoor. It works.

Posted: Thu Mar 08, 2007 5:34 pm
by us1aslam1us
IsValid("Integer", InLink.TheColumn) is more efficient.

Posted: Thu Mar 08, 2007 5:34 pm
by Sanket_Saraph
Hi,

You can just put following code in ur constraint to serve ur purpose
num(Field)

num(Field) : Returns True if Field is numeric.