Required Output

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

priyadarshikunal
Premium Member
Premium Member
Posts: 1735
Joined: Thu Mar 01, 2007 5:44 am
Location: Troy, MI

Post by priyadarshikunal »

In short "NO".

however once you have the desired output you can once again sort it in decending order.
Priyadarshi Kunal

Genius may have its limitations, but stupidity is not thus handicapped. :wink:
balu536
Premium Member
Premium Member
Posts: 103
Joined: Tue Dec 02, 2008 5:01 am

Post by balu536 »

Thanks to all who gave me the valuable suggestions.

As of now i sorted the data in ascending order and after getting the desired output i once again sorted to descending order which is some what time consuming process.

If any one tried this logic and achieved the required o/p with descending order of DATE in i/p please post here.

Thanks in Advance....
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

You can infact do it by descending date - if you are really really adamant.

You can send the years with corresponding previous year values followed by a lookup of the same in main stream.

Steps will be
1.) Send currentKey, currentYear, previousKey and previousYear values in another link (other than main stream)
2.) Using currentKey and currentYear, lookup same value in previousKey and previousYear and get currentkey and currentYear
3.) using values returned from 2 as current values, redo step 2
4.) Write record in output.

You can avoid multiple lookups by storing previous and previousPrevious values.

But again, it will be similar and quite complex than your current approach.
priyadarshikunal
Premium Member
Premium Member
Posts: 1735
Joined: Thu Mar 01, 2007 5:44 am
Location: Troy, MI

Post by priyadarshikunal »

Sainath.Srinivasan wrote:You can infact do it by descending date - if you are really really adamant.
That requirement will surely be for an Interview or Challenge to prove someone wrong. :wink:

one more way is to add two rows in source such that after sorting it goes to the last. Make sort sequential and in transformer(sequential) hold the records till the third record arrives.
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 »

Don't bother to hold them. Use a downstream Remove Duplicates stage to transfer only the last row of each group.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply