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
Why might the optimizer use a table scan when an index is available?
What is sort component in abinitio?
Difference between informatica vs ab initio?
I am unable to connect sever database(oracle) from gde(db config file) local system.i set all these?
What are the fundamental blocks of co> operating system of ab initio?
Have you ever encountered an error called “depth not equal”?
How do you add default rules in transformer?
What information does a .dbc file extension provides to connect to the database?
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?
What metadata importer can do in ab initio?
How scientific data processing is different from commercial data processing?
What are the components new in 2.14 compared to 1.8 and State the usage of the components?
How data is processed and what are the fundamentals of this approach?
What are the kinds of layouts does ab initio supports?
explain checkin and checkout?