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


Please Help Members By Posting Answers For Below Questions

Mention some ways for improving performance of a graph?

610


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

799


Explain PDL with an example?

808


What are the different types of partition components in abinitio?

765


Within a cursor, how would you update fields on the row just fetched?

624






What is local and formal parameter?

770


Describe the evaluation of parameters order in ab initio?

962


List out the file extensions used in abinitio?

661


To which project that prefix will set is to private project or public project or both?how and where to set?

1399


How to move or copy the project parameter or project object to my sandbox?

1817


What are the functions of the replicate and dedup component?

624


What do you understand by local lookup?

651


What is flow buffering ? How it reduces the chances of having deadlock ? How to use in abinitio graph?

2705


What are the co> operating system’s assorted library of integrated components?

654


What is the core of co> operating system?

639