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


Please Help Members By Posting Answers For Below Questions

Dear all, Please send me the ab initio pdfs and faqs i need... my mail id is rrajesh.intel@gmail.com

1928


What are the differences between different versions of co-op?

657


What do you know about partition and also tell us about partition components in abinitio?

691


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

1104


Explain what is sandbox?

723






Suppose we assign you a new project. What would be your initial point and the key steps that you follow?

697


The methods to improve performance of a graph?

720


What are the factors on which storage of data depends?

731


What is a local lookup?

791


What are the reasons for which business can trust the approach of data processing?

718


What is a deadlock and how it occurs?

760


We know rollup component in abinitio is used to summarize group of data record then why do we use aggregation?

994


What do you mean by the term data warehousing?

715


What is the function that transfers a string into a decimal?

776


How data is processed and what are the fundamentals of this approach?

746