create a job to get the previous row salary for the current row.if there is no previous row exists for the current row,then the previous row salary should be displayed as null?
empid   salary   previoussalary
10      1000     null
20      2000     1000
30      3000     2000      
40      4000     3000

Answer Posted / indu

input file->transformer-> output file

in transformer declare stage variables as below:
current salaray
salary
previous salary

Initialize previous salary to null

current salary ---> previous salary
previous salary----> salary



In the output file derive the previous salary as

previousalary--->previous slary (stage variable)

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what is ds administrator used for?

951


what is the custome stage in datastage? how can we impliment that one? plz tell me

2167


root tree will find which is server job and which is parallel job?

1676


Highlight the main features of datastage?

856


1)what is the size of Fact table and dimension table? 2)how to find the size of Fact table and dimension table? 3)how to implement the surrogate key in transform stage? 4)write the configuration file path? 5)how many types of datasets explain? 6)diff b/w developed projects and migration projects? 7)how to delete the header and footer file of the sequencer file? 8)how can u call the parameters in DS in unix environment? 9) how much data ur getting daily ? 10)

2533


Define Data Stage?

877


Differentiate between odbc and drs stage?

831


What are the different type of jobs in datastage?

862


What are the stages in datastage?

857


tell me 5 situations when we r using oracle db stages like orecle connector, oracle enterprise

2948


Hi , Can anyone give few examples of scenarios and there corresponding design in datastage..i am new to this tool...confused in design while my manager asking to design the job.. Please post the URL if there..so i can go through it.. Thanks in advance...

3987


How do you generate sequence number in datastage?

870


How many Key we can define in remove duplicate stage?

1090


I have a few records just I want to store data in to targets cycling way how?

2160


EXPLAIN SCD

1184