Update previous record based on current

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
loveojha2
Participant
Posts: 362
Joined: Thu May 26, 2005 12:59 am

Post by loveojha2 »

Store the previous record in the Stage Variables.

If the condition is satisifed for changing the previous record then process the previous record with the changes and send it in on a different link (which will be an update link) (the insert link will be used for current record).

Although it is an outline, Hope you will find it useful.
Success consists of getting up just one more time than you fall.
gateleys
Premium Member
Premium Member
Posts: 992
Joined: Mon Aug 08, 2005 5:08 pm
Location: USA

Post by gateleys »

Try using the RowProcCompareWithPreviousValue() function available with DataStage. It allows you to compare your current value with the previous value.

gateleys
rcil
Charter Member
Charter Member
Posts: 70
Joined: Sat Jun 05, 2004 1:37 am

Post by rcil »

gateleys wrote:Try using the RowProcCompareWithPreviousValue() function available with DataStage. It allows you to compare your current value with the previous value.

gateleys
Thanks for the inputs. I was successfull in comparing the previous and current values and also successfull in checking the date ranges.

What I want here is updating the previous record based on the current.

thanks
Thanks,
RCil
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

If you change your sort order then you would be changing your current record based on the previous one - meaning you wouldn't need to do an update of a changed record.
vcannadevula
Charter Member
Charter Member
Posts: 143
Joined: Thu Nov 04, 2004 6:53 am

Post by vcannadevula »

rcil wrote:
gateleys wrote:Try using the RowProcCompareWithPreviousValue() function available with DataStage. It allows you to compare your current value with the previous value.

gateleys
Thanks for the inputs. I was successfull in comparing the previous and current values and also successfull in checking the date ranges.

What I want here is updating the previous record based on the current.

thanks

Why donot you order your data based on MNO, PTYPE asc, PNO DESC
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

The previous record has already been processed when you are processing the current record, and therefore can not be edited other than in a second pass through the data or some form of intermediate storage that can be updated (for example a UV stage).
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