Page 1 of 1

19 Length numeric characters in constraints section

Posted: Mon Jan 31, 2005 9:21 am
by kccsol
Hi,
I'm having a serious problem. In my guess, this one could be a big issue in DataStage. I want you to make a sample job and test as I describe below, if you can.
There are two data '1234567890123456789' and '1234567890123456788'.
These two data are both character types (VARCHAR 25 lengths). Only one difference between two data is the last(19th) character.

I will assume the first string as "ID1" and the other one as "ID2".
I put a constraint in the transformer like this [ ID1 <> ID2 ].
In general, the result should be TRUE. But it was opposite, FALSE.

I really want to know the reason and the resolution.
Thank you.

Posted: Mon Jan 31, 2005 9:44 am
by ArndW
Hello kccsol,

I am sure that this issue has been handled several times. You can modify your configuration file to allow numbers of length 19 to be correctly managed without truncation, or write your own string-math functions. The config parameter is "EXACTNUMERIC 15" and you can specify a number of up to 57 digits. The procedure for changing & activating a new UVCONFIG file can be found in the documentation.

Posted: Mon Jan 31, 2005 9:47 am
by chulett
You can also use the string math functions already supplied, like those mentioned in this post.

Or, for example, you can use Compare() to test them rather than the <> operator.

Posted: Mon Jan 31, 2005 9:57 am
by Jay
One resolution will be to use Matches to do the comparision instead of <>.

I am not sure if we are supposed to use <> while comparing strings...

Jay

Posted: Mon Jan 31, 2005 10:03 am
by ArndW
Jay & Craig just pointed the thread into the correct direction. If you don't need to do any math operations on the strings, then using a "<>" operator will force DS will do a conversion from string to numeric. If you use the syntax listed by them or a NOT(A=B) then it will be a string operation and no conversion will be done (much faster) and you won't have to play around with reconfigurations and possible truncations.
So ignore my first post unless you really need to do large number maths.

Posted: Mon Jan 31, 2005 11:24 am
by kccsol
Thank you for all your reply.
I tried two kinds of approaching.
I used "NOT(A=B)" at first, but there was no change.
So I applied "Compare(A,B) <> 0 ". That was effective.

I don't know why the first one was not effective but, anyway, I am happy to get a resolution for all of your helps.

Again, I really appreciate your concern.
Thanks.