Page 1 of 1

Decimal Check

Posted: Wed Jul 13, 2005 10:12 am
by pandu80
Hi,

Is 22. decimal or not?. If it is a decimal how do i check?

TIA

Posted: Wed Jul 13, 2005 10:20 am
by Sainath.Srinivasan
What do you mean by decimal?

If you want to check whether it is numeric or 'non alphabetic', use OConv.

You can use Num() for other situations.

Re: Decimal Check

Posted: Thu Jul 14, 2005 5:13 am
by ray.wurlod
pandu80 wrote:Is 22. decimal or not?.
It depends.

There are no data types in DataStage server edition, so the data type depends on what you're doing with it. The value you cite could be an integer, a decimal, a floating point number or a character string, depending on the context.

Further, the notion of data type doesn't really apply to data; it applies to the columns in which the data are stored.

Certainly you can construct a test that answers the question (does this string of characters contain only an optional sign, zero or more numeric digits, a decimal place designator followed by zero or more numeric digits) if that's your definition of "decimal". But most database would allow you to insert 22 (without the ".") into a column whose data type is "Decimal".

Further, if there are thousands delimiters, what do you want your test to do?

And, finally, your locale may influence what represents a decimal. For example in may European countries "," is used as the decimal place designator (for instance 74,3). Should this satisfy your test?

More thought is required, ne c'est pas? Happy Bastille Day!