How can I get the minimum date in the aggregator?

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

Post by ray.wurlod »

I don't know that there's a solution but, as a workaround, convert your date to a Julian date (int32 or int64, perhaps) and take the minimum of that.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
igorbmartins
Participant
Posts: 161
Joined: Mon Mar 17, 2008 10:33 am

Post by igorbmartins »

Really? It Is not have other way? I thought in use the function iconv, but I see that in the Parallel JOB it is not work. How can I convert this date to int?

Thanks.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

What about leaving it as a string (not a date) with the string in 'yyyy-mm-dd' format and then taking the minimum of that? That or an integer in 'yyyymmdd' format.
-craig

"You can never have too many knives" -- Logan Nine Fingers
priyadarshikunal
Premium Member
Premium Member
Posts: 1735
Joined: Thu Mar 01, 2007 5:44 am
Location: Troy, MI

Post by priyadarshikunal »

probably you can try to set the additional option 'Preserve Type' to true.
Priyadarshi Kunal

Genius may have its limitations, but stupidity is not thus handicapped. :wink:
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Preserve Type will work. I believe this is only available in version 8.1 and later.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
samder76
Participant
Posts: 1
Joined: Mon Jan 28, 2008 10:01 am

Post by samder76 »

Instead of using an aggregator stage to find a minimun date, you can use a "Remove Duplicates" sorting your date data with the "ascending" option (when you specify your partitioning). Finally, you have just to retain the first row (duplicate to retain : first). It works well with date type for each version.
Samuel
ajay.vaidyanathan
Participant
Posts: 53
Joined: Fri Apr 18, 2008 8:13 am
Location: United States

Post by ajay.vaidyanathan »

Hi,

Your DATA basically contains "DATE" values and your aggregator gets your output in "DOUBLE" data type. So convert your DATA column to a format compatible with DOUBLE data type and then try using Aggregator.
Regards
Ajay
TonyInFrance
Premium Member
Premium Member
Posts: 288
Joined: Tue May 27, 2008 3:42 am
Location: Luxembourg

Post by TonyInFrance »

Old topic (I know) but I had to go through this (and other similar ones) since I was looking for a solution.

On a hunch I tried the option Preserve type = True within the Aggregator itself....worked fine...:-) No more warnings / aborts.

Basically what happens I guess is on choosing to preserve the datatype the output of the aggregator remains in iys source format.
Tony
BI Consultant - Datastage
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

You really decided to spread the love around, eh?

It has been mentioned a number of times over the years, I got 40+ hits when searching for "preserve type" just now. Up by four from yesterday. :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
TonyInFrance
Premium Member
Premium Member
Posts: 288
Joined: Tue May 27, 2008 3:42 am
Location: Luxembourg

Post by TonyInFrance »

Ha ha @ Craig

But before you and the Ray discipline me for the misdemeanor, in my defense I found 4 hits when I searched for the error message - No default type conversion from type "date" to type "dfloat".

Thought I'd thus update all 4 since in neither of them was the "preserve type" suggested as a possible solution...:-)
Tony
BI Consultant - Datastage
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Ha! There was no intent to discipline, I was just amused to keep finding your post as I worked my way through all the new posts that morning. :wink:
-craig

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