How can you find the 2nd Highest salary in a file department wise in abinitio?
Answer Posted / murali krishna udayagiri
Yes Vital is correct. This can be acheived using SCAN
component with only one variable.
1.Input_file
2.Sort with in group (dno asc,sal desc)
3.scan
###############################################
type temporary_type=record
integer(4) temp1;end;
temp :: initialize(in) =
begin
temp.temp1::0;
end;
out :: scan(temp, in) =
begin
out.temp1 :: temp.temp1 + 1;
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
Thanks,
Murali Udayagiri
Mail id: udayagiri.murali@gmail.com
| Is This Answer Correct ? | 3 Yes | 8 No |
Post New Answer View All Answers
What are the primary keys and foreign keys?
What do you understand by a cartesian join?
What are the steps to create a repository in ab initio?
What are the facts that can compromise data integrity?
What are the fundamental blocks of co> operating system of ab initio?
What a local lookup is?
What are the different types of parallelism used in abinitio?
Runtime behavior of Normalize and Reformat
How can you export a component’s internal parameters ?
What do you mean by data sorting?
What are the components new in 2.14 compared to 1.8 and State the usage of the components?
What happens when we provide null key to sort, merge and pbks in Abinitio ?
What are the six data process products of ab initio (architecture of ab initio)?
What is a rollup component? Explain about it.
What is the difference between a scan component and a rollup component?