IsValidDecimal issue in IIS8.7

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

prasson_ibm
Premium Member
Premium Member
Posts: 536
Joined: Thu Oct 11, 2007 1:48 am
Location: Bangalore

Post 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.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Again, that's a question for your official support provider.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post 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.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Interesting... if it's already in a decimal data type, what 'possible errors' are we talking about? Precision and scale?
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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)?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

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

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
SURA
Premium Member
Premium Member
Posts: 1229
Joined: Sat Jul 14, 2007 5:16 am
Location: Sydney

Post 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.
Thanks
Ram
----------------------------------
Revealing your ignorance is fine, because you get a chance to learn.
prasson_ibm
Premium Member
Premium Member
Posts: 536
Joined: Thu Oct 11, 2007 1:48 am
Location: Bangalore

Post by prasson_ibm »

Thanks Sura and everyone.
SURA
Premium Member
Premium Member
Posts: 1229
Joined: Sat Jul 14, 2007 5:16 am
Location: Sydney

Post 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.
Thanks
Ram
----------------------------------
Revealing your ignorance is fine, because you get a chance to learn.
SURA
Premium Member
Premium Member
Posts: 1229
Joined: Sat Jul 14, 2007 5:16 am
Location: Sydney

Post by SURA »

One more point.
IBM wrote:isValidDecimal() is specific for the range lookup of an already existing decimal value.
Thanks
Ram
----------------------------------
Revealing your ignorance is fine, because you get a chance to learn.
Post Reply