Page 1 of 1

mathematical functions for larger data types ????

Posted: Wed Mar 09, 2016 5:19 pm
by hsahay
Hi

Functions like MAX, MIN, CEIL, FLOOR etc work on INT32 datatype.

What if my variables are larger than int32 ?

For example, the signature for MAX is

number1 (int32),number2(int32) returns int32

What if the values i need to compare are int64 ? or even Double. Are there no functions for larger data types than int32 ?

Posted: Thu Mar 10, 2016 8:25 am
by qt_ky
You will get incorrect results when using larger int64 values, when the arguments are expected to be int32. Test it out and see.

Ask IBM Support or the IBM DataStage Product Manager about it. Please let us know if you find anything out.

Posted: Thu Mar 10, 2016 8:29 am
by chulett
The Server side of the world has "string" functions to do things like math on large numbers, is there any equivalent here?

Posted: Thu Mar 10, 2016 9:45 am
by hsahay
Thanks QT_KY. That is precisely what has been happening with us. Overflow and data corruption all over the place. Which is what prompted me to ask this question.

Does anyone know of any options if one needs to use these functions on larger datatypes ?

Posted: Thu Mar 10, 2016 10:03 am
by hsahay
Chulett - Hi ! Can you please elaborate on that with examples ? Are you saying that there are string functions in server jobs that can be used for mathematical operations of the kind i mentioned in my original post ?

Posted: Thu Mar 10, 2016 10:10 am
by chulett
Those functions are documented in the BASIC manual and from what I recall are just for basic math: SADD, SSUB, SMUL and SDIV off the top of my aging head. I was just wondering if there is anything remotely similar on the PX side...

Posted: Fri Mar 11, 2016 3:01 pm
by ray.wurlod
The parallel engine does not have the string math functions to which Craig referred.

Posted: Fri Mar 11, 2016 4:08 pm
by asorrell
And if I remember correctly, the string math functions in the server jobs are VERY slow compared to normal math functions.

Posted: Fri Mar 11, 2016 4:29 pm
by chulett
Sure... but you only used them on data that the 'normal' functions couldn't handle. :wink: