Validation of Integer value

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
dsguy
Participant
Posts: 34
Joined: Thu Mar 09, 2006 10:37 am

Validation of Integer value

Post by dsguy »

Hi

I have a requirment where input is comes as string and i have to convert it to integer.If Input string dosent have proper number value then the record to be replaced with 0.
Please let me know ifr there is any function through which we can validate if it is a interger value or not.

ex
Input string Output
5423 5423
54ab3 0


Thanks for ur help
Maveric
Participant
Posts: 388
Joined: Tue Mar 13, 2007 1:28 am

Post by Maveric »

try using Convert function and change all integer values to blank. if it is a number then your output will be blank. If it is not then u will have the alphabets. Check the length of the output of the convert function. if it is zero direct mapping else 0.
balajisr
Charter Member
Charter Member
Posts: 785
Joined: Thu Jul 28, 2005 8:58 am

Post by balajisr »

You can also use Num function.

Code: Select all

 if Num(inLink.Col) then inLink.Col else 0
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Best is the parallel function IsValid().
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply