function

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
sainath
Premium Member
Premium Member
Posts: 138
Joined: Fri Nov 19, 2004 3:57 pm

function

Post by sainath »

hi
i have a bussiness conditon that if a row contains PRE then compare with below one and if it contains POST compare with above row.
i am using rowcompare to compare with previous value .
my question is how to compare with next row.
do we have any rowcomparenext ---.
pl share your thoughts.
thks
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

How do you expect to compare with the next row when you haven't even read the next row yet???

The best you can do is to store the previous row's value and compare when POST comes through. You need your data sorted for this to work properly, of course.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

Or you can have one extra stage variable set to store CURRENT, IMMEDIATE PREVIOUS, PREVIOUS TO IMMEDIATE PREVIOUS.
So that if it is PRE you can use IMMEDIATE PREVIOUS and PREVIOUS TO IMMEDIATE PREVIOUS.
If is is POST you can use CURRENT and IMMEDIATE PREVIOUS.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
sainath
Premium Member
Premium Member
Posts: 138
Joined: Fri Nov 19, 2004 3:57 pm

Post by sainath »

hi
thanks for your reply.still i am not able to find the solution for this problem.if i got PRE RECORD i should compare with next row not the
immediate previous record. can you please share your thoughts
to solve this problem
thks


<i have a bussiness conditon that if a row contains PRE then compare with below one and if it contains POST compare with above row.
i am using rowcompare to compare with previous value .
my question is how to compare with next row.
do we have any rowcomparenext ---.
pl share your thoughts. >
thks
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

You have not yet read the next record.

Therefore you can not compare anything to it.

What you ask is impossible.

Is that sufficiently definitive?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Ray, i remember you once mentioning that the Harry Potter stage can do stuff like this. Right ? :lol:
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

Ray has already mentiond in his post that it not possible to compare a record even before it was read or accessed.
You can compare yesterday and today and not today and tomorrow.
If you have read 0,1,2 and if you need to compare current and previous and current and need to compare 1 and 2 similarly 2 and 3. where you havent read 3 so far.
Hence Move your reference level to one level up.
For first case read compare 0 and 1. And for second case compare 1 and 2.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
Post Reply