Page 2 of 2

Posted: Mon Sep 02, 2013 9:13 am
by prasson_ibm
Hi There,

I have done below tests :-

Code: Select all

IsValid("decimal[12,2]","1234567891011.123")=0
IsValid("decimal[12,2]","12345.12")=1
IsValid("decimal[12,2]","ABC01")=0
IsValid("decimal[12,2]","12345,12")=0
It seems to working fine.Thanks a lot for help. :)

But still we have question on IsValidDecimal() why it is not working as expected.

Posted: Mon Sep 02, 2013 9:25 am
by chulett
Again, that's a question for your official support provider.

Posted: Mon Sep 02, 2013 10:01 am
by ArndW
prasson_ibm wrote:..But still we have question on IsValidDecimal() why it is not working as expected...
IsValidDecimal takes a DECIMAL as the parameter and checks for the other possible errors. Thus using IsValidDecimal("Hello") implictly converst "Hello" to a decimal, resulting in 0, which in turn is a valid decimal.

Posted: Mon Sep 02, 2013 2:39 pm
by chulett
Interesting... if it's already in a decimal data type, what 'possible errors' are we talking about? Precision and scale?

Posted: Mon Sep 02, 2013 11:17 pm
by ray.wurlod
prasson_ibm wrote:...it is not working as expected.
What do you expect, and what do you get when "it is not working as expected"?

What exact version of DataStage (from Help About)?

Posted: Tue Sep 03, 2013 2:37 am
by ArndW
chulett wrote:Interesting... if it's already in a decimal data type, what 'possible errors' are we talking about? Precision and scale?
That confused me as well as it doesn't seem to make sense, but as you noted it is the scale and precision as well as the zero-value-flag that is checked for.

Posted: Tue Sep 03, 2013 3:55 am
by ray.wurlod
I think you'll find that all the IsValid... functions expect a string as the principal argument. They report whether the string could be validly converted.

Posted: Tue Sep 03, 2013 11:38 pm
by SURA
I raised a PMR with IBM for the same issue and just now IBM confirmed, it seems bug in the code. They have recommended to use IsValid for now.

Posted: Wed Sep 04, 2013 4:49 am
by prasson_ibm
Thanks Sura and everyone.

Posted: Wed Sep 11, 2013 7:41 pm
by SURA
Today i got the feedback from IBM.
IBM wrote:They said that the parameter of isValidDecimal had to be a decimal value.
They promised to enhance the document to avoid misleading although it would take a while.
That means isValidDecimal needs a proper decimal as an input.

Posted: Wed Sep 11, 2013 10:44 pm
by SURA
One more point.
IBM wrote:isValidDecimal() is specific for the range lookup of an already existing decimal value.