Transformer logic

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
kashif007
Premium Member
Premium Member
Posts: 216
Joined: Wed Jun 07, 2006 5:48 pm
Location: teaneck

Transformer logic

Post 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
Yuan_Edward
Participant
Posts: 73
Joined: Tue May 10, 2005 6:21 pm
Location: Sydney

Re: Transformer logic

Post 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
Edward Yuan
kashif007
Premium Member
Premium Member
Posts: 216
Joined: Wed Jun 07, 2006 5:48 pm
Location: teaneck

Post 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.
mansoor_nb
Participant
Posts: 48
Joined: Wed Jun 01, 2005 7:10 am

Post 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
kashif007
Premium Member
Premium Member
Posts: 216
Joined: Wed Jun 07, 2006 5:48 pm
Location: teaneck

Post by kashif007 »

Thanks Mansoor. It works.
us1aslam1us
Charter Member
Charter Member
Posts: 822
Joined: Sat Sep 17, 2005 5:25 pm
Location: USA

Post by us1aslam1us »

IsValid("Integer", InLink.TheColumn) is more efficient.
I haven't failed, I've found 10,000 ways that don't work.
Thomas Alva Edison(1847-1931)
Sanket_Saraph
Participant
Posts: 20
Joined: Tue Jun 13, 2006 5:16 am
Location: Pune

Post 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.
SANKET SARAPH
Post Reply