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
What are the key elements of a data processing system?
When using multiple dml statements to perform a single unit of work, is it preferable to use implicit or explicit transactions, and why?
What do you understand by local lookup?
What information does a .dbc file extension provides to connect to the database?
What is a rollup component?
Mention what information does a .dbc file extension provides to connect to the database?
Tell us about the architecture of abinitio.
i have a scenario where i need to change the value of a sort order in my sort component whether ascending or descending depend on some input value... e.g if input_val = A then sort order should be ascending else descending I have to use PDL in this... Can you please tell me where do i have to make this change and how ?
What is the difference between formal and export parameter? Export at what secenario we are going to use?
Explain how you can run a graph infinitely in ab initio?
What are “business rules” in ab initio business rules environment (bre)?
What are the primary keys and foreign keys?
What are the co> operating system’s assorted library of integrated components?
How to run a graph infinitely?
What are the Types of parallelism in detail?