Need to check the number format

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
Xpert
Premium Member
Premium Member
Posts: 85
Joined: Wed Mar 01, 2006 7:17 am

Need to check the number format

Post by Xpert »

Hi,

I am getting numeric values in a column. It contains both kind of numeric values i.e. 123 and 123.45

Now I need to check whether the incoming value is whole value(123) or floating value(123.45).

Could anyone help me how to check the value?

Thanks in Advance
With regards,
Xpert
Kryt0n
Participant
Posts: 584
Joined: Wed Jun 22, 2005 7:28 pm

Post by Kryt0n »

Does 123.00 count as a whole value of floating point?

Scan for decimal point?
<value> mod 1 > 0?
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Index(InLink.TheString, ".", 1) will return 0 if there is no "." and a positive number if there is.
(InLink.TheString Matches "1N0N" : @VM : "1N0N'.'0N") will test for unsigned numeric formats.
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