Current row to Next row processing

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
pratapsriram
Premium Member
Premium Member
Posts: 41
Joined: Tue Jan 24, 2006 3:43 pm
Location: United States
Contact:

Current row to Next row processing

Post by pratapsriram »

I have a peculiar scenario. I want to capture the Time taken between two transactions and assign the elapsed time to the first transaction record. I could do this but assign to the next transaction instead of the first one. So if anyone can tell if the other way is possible? Please find the attached screenshot in the below

http://sites.google.com/site/makamsreer ... ow_nextrow
Knowledge is Power
pandeesh
Premium Member
Premium Member
Posts: 1399
Joined: Sun Oct 24, 2010 5:15 am
Location: CHENNAI, TAMIL NADU

Post by pandeesh »

Once i had a similar scenario and achieved using stage variables in transformer stage.
By utilizing the power of stage variable to retain the previous value.
I don't think it's a peculiar scenario
:)
pandeeswaran
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

You've misread the requirement I'm afraid.
-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 »

Other than in the first two rows your example does not appear to be doing what you describe. Can you please clarify? In general DataStage does not have a lookahead capability; you may need to design to update the first row (of each pair?) subsequently.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Kryt0n
Participant
Posts: 584
Joined: Wed Jun 22, 2005 7:28 pm

Post by Kryt0n »

You can try split and join with row x joining to x+1 and then you have both values on the same line. (Couldn't see your diagram so suggestion not based on anything reflected in that)

Edit: Except you're on server... could've sworn I saw Parallel...
Kryt0n
Participant
Posts: 584
Joined: Wed Jun 22, 2005 7:28 pm

Post by Kryt0n »

Reverse the order so that the oldest record is last, then use stage variables to hold the newer time.
pratapsriram
Premium Member
Premium Member
Posts: 41
Joined: Tue Jan 24, 2006 3:43 pm
Location: United States
Contact:

Resolved - Please close

Post by pratapsriram »

Kryt0n wrote:Reverse the order so that the oldest record is last, then use stage variables to hold the newer time.
Thanks, Yes this is what I did exactly. I ordered in desc order and then processed using stage variables.
Knowledge is Power
Post Reply