substring function

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
laxmi_etl
Charter Member
Charter Member
Posts: 117
Joined: Thu Sep 28, 2006 9:10 am

substring function

Post 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
nick.bond
Charter Member
Charter Member
Posts: 230
Joined: Thu Jan 15, 2004 12:00 pm
Location: London

Post 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.....
Regards,

Nick.
laxmi_etl
Charter Member
Charter Member
Posts: 117
Joined: Thu Sep 28, 2006 9:10 am

Post 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
Post Reply