Page 1 of 1

Function in datastage

Posted: Thu Jan 05, 2006 6:29 am
by vijayindukuri
Hi all
i have a scenario where i need to check for value which is comming from the source that is if the value is number like 23410 the value must be entered into to the target or if any bad number like 23456# comes from the source then it must be rejected and send into the error master table
Is this type of checking possible in datastage
Can any one help me in coding for this kind of situation

Posted: Thu Jan 05, 2006 6:50 am
by Luciana
You can to use the NUM function (BASIC) for to check if the value is numeric.

Posted: Thu Jan 05, 2006 11:11 am
by ds_developer
Remember NUM will allow decimal point (.) and negative sign (-) as they are considered part of a normal datastage number.

John

Posted: Thu Jan 05, 2006 12:43 pm
by Luciana
Yes.
You can to use the Ereplace Function for to remove decimal point (.) and negative sign (-), before of to check if the value is numeric.

Posted: Thu Jan 05, 2006 1:30 pm
by ArndW
Luciana, I think that ds_developer's point is that strings with a "-" and "." (or a ',' if the NLS locale is enabled) will be returned as legal numeric, so you don't need to use an additional function to remove them.

Posted: Thu Jan 05, 2006 1:58 pm
by Luciana
Really, it is not necessary to remove the decimal point (.) and the negative sign (-).