Page 1 of 1

substring function

Posted: Wed May 09, 2007 3:51 pm
by laxmi_etl
Hi,

I have a field 'X' varchar(22).
I need to use substring function [11,4].
substring function is working.
If I have a charecter in the 4 digits value I have to write it to a rej file in the transformer otherwise I need to write the record in the someother file.

I tried AlNum function but it is not working.

Any other idea.

Thanks

Posted: Wed May 09, 2007 4:05 pm
by nick.bond
Do you mean if there is anything other than a number in the substring then reject that substring?

If yes

Code: Select all

If Num(string[11,4]) Then ....... Else reject.....

Posted: Wed May 09, 2007 4:16 pm
by laxmi_etl
Ya I tried the same function that you gave me for the ones coming in with num for the four digit length and I wrote those records to one file.

And in the rej file I used Not(Num(input Column(11,4)))function for the records which has charecter in the 4 lengh value ex(12c3).

That is working good.

Anyhow thanks for your help