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
How can a graph be run infinitely?
What is the max core of a component?
Give one reason when you need to consider multiple data processing?
What are the factors on which storage of data depends?
How can I run the 2 gui merge files?
Mention what is the syntax for m_dump in abinitio?
Suppose we assign you a new project. What would be your initial point and the key steps that you follow?
State the working process of decimal_strip function?
What do you mean by data sorting?
What you can store, manage and reuse centrally in ab initio enterprise meta>environment (eme)?
What do you mean by a transaction file and how it is different from that of a sort file?
Explain data flow graph with an example?
What is the purpose of having stored procedures in a data-based?
how will i can implement Insert a new record (if not present in Input file),Update the record (if present in input) a csv file in Abinitio
What is broadcasting and replicate?