Decimal Check

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
pandu80
Participant
Posts: 50
Joined: Fri Apr 08, 2005 5:56 pm

Decimal Check

Post by pandu80 »

Hi,

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

TIA
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post 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.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Re: Decimal Check

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