mathematical functions for larger data types ????

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

Post Reply
hsahay
Premium Member
Premium Member
Posts: 175
Joined: Wed Mar 21, 2007 9:35 am

mathematical functions for larger data types ????

Post 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 ?
vishal
qt_ky
Premium Member
Premium Member
Posts: 2895
Joined: Wed Aug 03, 2011 6:16 am
Location: USA

Post 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.
Choose a job you love, and you will never have to work a day in your life. - Confucius
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

The Server side of the world has "string" functions to do things like math on large numbers, is there any equivalent here?
-craig

"You can never have too many knives" -- Logan Nine Fingers
hsahay
Premium Member
Premium Member
Posts: 175
Joined: Wed Mar 21, 2007 9:35 am

Post 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 ?
vishal
hsahay
Premium Member
Premium Member
Posts: 175
Joined: Wed Mar 21, 2007 9:35 am

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

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

The parallel engine does not have the string math functions to which Craig referred.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
asorrell
Posts: 1707
Joined: Fri Apr 04, 2003 2:00 pm
Location: Colleyville, Texas

Post by asorrell »

And if I remember correctly, the string math functions in the server jobs are VERY slow compared to normal math functions.
Andy Sorrell
Certified DataStage Consultant
IBM Analytics Champion 2009 - 2020
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Sure... but you only used them on data that the 'normal' functions couldn't handle. :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply