getting previous record value

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
sri75
Premium Member
Premium Member
Posts: 132
Joined: Thu Sep 09, 2004 12:42 pm

getting previous record value

Post by sri75 »

Hello to all,

There are few records from source table like this

Code: Select all

id  name     date         status
1   xxxx    01/01/01      y
1   xxxx    02/02/02  
1   xxxx    05/05/05        
there is no status value for 2 other records.My req is if id and name matches then need to put staus 'y' in two ther records also.

I used stage variables to get the previous record value, but it worked if there are only 2 records with same ids,for the third record ,it is putting previous record value 'space' because 2nd record doesn't have any value.Can you please tell me how to do that

Thanks
Sri
WoMaWil
Participant
Posts: 482
Joined: Thu Mar 13, 2003 7:17 am
Location: Amsterdam

Post by WoMaWil »

Hi Sri,

it depends how you fill it.

IF FIELD="Y" THEN "Y" ELSE IF FIELD="N" THEN "N" ELSE FIELD

so you have y or n or a previous.
Wolfgang Hürter
Amsterdam
sri75
Premium Member
Premium Member
Posts: 132
Joined: Thu Sep 09, 2004 12:42 pm

Post by sri75 »

Thanks WoMaWil for your reply


Here it is logic

svCurrentValue =svPreviousValue
input.field =svCurrentValue

Code: Select all

id  name     date         status
1   xxxx    01/01/01      y
1   xxxx    02/02/02 
1   xxxx    05/05/05        
for the 2nd record it puts 'Y' ,because previous record has value 'Y' ,when it goes for 3rd record ,previous record from source table has space .So it is putting space in the 3rd record

Code: Select all

id  name     date         status
1   xxxx    01/01/01      y
1   xxxx    02/02/02      y
1   xxxx    05/05/05        
I think here I need to hold the value of first record every time.Can you please give me some idea

Thanks
Post Reply