19 Length numeric characters in constraints section

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
kccsol
Participant
Posts: 2
Joined: Tue Feb 03, 2004 8:21 pm
Contact:

19 Length numeric characters in constraints section

Post 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.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

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

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Jay
Participant
Posts: 105
Joined: Tue Nov 11, 2003 8:28 pm

Post 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
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post 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.
kccsol
Participant
Posts: 2
Joined: Tue Feb 03, 2004 8:21 pm
Contact:

Post 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.
Post Reply