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


Please Help Members By Posting Answers For Below Questions

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

1811


What is sort component in abinitio?

702


Difference between informatica vs ab initio?

715


I am unable to connect sever database(oracle) from gde(db config file) local system.i set all these?

670


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

732






Have you ever encountered an error called “depth not equal”?

649


How do you add default rules in transformer?

742


What information does a .dbc file extension provides to connect to the database?

719


How can you SORT an already partitioned (round-robin) data ? How to use in abinitio graph? 3. How internally partition by key decides which key to send in which partition ? How to use in abinitio graph? 4. What is PDL ? Give him a shell type parameter and ask him to convert it to PDL. How to use in abinitio graph? 5. As shell type parameters are not supported by EME, then how you can use shell type parameter (If you don't want to use PDL) without hampering lineage diagram ? How to use in abinitio graph? 6.How you can generate dml from a COBOL copy book ? How to use in abinitio graph? 7. How you can convert from ebcdic to packed decimal ? How to use in abinitio graph?

3899


What metadata importer can do in ab initio?

703


How scientific data processing is different from commercial data processing?

633


What are the components new in 2.14 compared to 1.8 and State the usage of the components?

1716


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

645


What are the kinds of layouts does ab initio supports?

579


explain checkin and checkout?

667