How can you find the 2nd Highest salary in a file department wise in abinitio?
Answer Posted / raje0303
Hi Murali,
This logic is correct only will fail when highest salary entries are more than one (e.g. two people has highest and equal salary )
we need to updated scan function as below -
type temporary_type=record
integer(4) temp1;
integer(4) last_sal;
end;
temp :: initialize(in) =
begin
temp.temp1::0;
temp.last_sal::0;
end;
out :: scan(temp, in) =
begin
if(last_sal != in.salary)
begin
out.temp1 :: temp.temp1 + 1;
end;
last_sal = in.salay;
end
out :: finalize(temp, in) =
begin
out.sal:: in.sal;
out.dno :: in.dno;
out.temp1 :: temp.temp1;
end;
out :: output_select(out) =
begin
out::out.temp1 == 2;
end;
###############################################
4.Output_file
Is This Answer Correct ? | 6 Yes | 2 No |
Post New Answer View All Answers
Dear all, Please send me the ab initio pdfs and faqs i need... my mail id is rrajesh.intel@gmail.com
What are the differences between different versions of co-op?
What do you know about partition and also tell us about partition components in abinitio?
Input A 100 NUll A NUll 200 B 100 Null B Null 300 Output A 100 200 B 100 300 Do this using Ab initio
Explain what is sandbox?
Suppose we assign you a new project. What would be your initial point and the key steps that you follow?
The methods to improve performance of a graph?
What are the factors on which storage of data depends?
What is a local lookup?
What are the reasons for which business can trust the approach of data processing?
What is a deadlock and how it occurs?
We know rollup component in abinitio is used to summarize group of data record then why do we use aggregation?
What do you mean by the term data warehousing?
What is the function that transfers a string into a decimal?
How data is processed and what are the fundamentals of this approach?