How can you find the 2nd Highest salary in a file department wise in abinitio?

Answer Posted / ravi

we can do this with scan comp
exp::i/p folloed by sort folloed by scan and o/p
ip record
id,dept_name,sal
in sort keep key fields as (dept_name,sal descending)
 now in scan write this T/f in parametres

type temporary_type
record
decimal("")secno;
end;
temp::initialize(in)=
begin
temt.secno::0;
end;
temp::scan(temp,in)=
out::finalize(temp,in)=
begin
out.in::in.id;
out.ddept_name::in.dept_name;
out.secno::temp.secno;
out.sal::in.sal;
end;
out::out_select(out)=
begin
out::out.secno==2
end;

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the kinds of layouts does ab initio supports?

576


Explain what is de-partition in abinitio?

832


Give one reason when you need to consider multiple data processing?

627


How do you improve the performance of a graph?

674


Pdl with an example?

652






Mention some ways for improving performance of a graph?

609


What is brodcasting and replicate?

718


Difference between output_index and output_indexes in reformat

751


explain the environment varaibles with example?

627


What do you understand by overflow errors?

627


What are the fundamental blocks of co> operating system of ab initio?

731


What are the facts that can compromise data integrity?

627


What are the functions of the replicate and dedup component?

624


Mention what the difference between “look-up” file and “look is up” in abinitio?

805


Explain batch processing in ab initio?

918