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 ?    2 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How data is processed and what are the fundamentals of this approach?

746


What are the Types of parallelism in detail?

790


Why do you think data processing is important?

738


What are the benefits of data analyzing?

771


Why might the optimizer use a table scan when an index is available?

1918






What are the features of ab initio?

727


What are the operations that support avoiding duplicate record?

1064


How to create a repository in abinitio for stand-alone system(local nt)?

739


What is MAX CORE of a component?

820


How do you add default rules in transformer?

828


Mention some ways for improving performance of a graph?

702


What would be the next step after collecting the data?

830


What is the difference between check point and phase?

764


difference between paramaters inputparameters,Local parameters, Formal parameters, Sand box parameters,Project parameters and export parameter?

2403


What happens when we provide null key to sort, merge and pbks in Abinitio ?

1028