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
What is the function you would use to transfer a string into a decimal?
What is a local lookup?
What is ab initio enterprise meta>environment (eme)?
How do you truncate a table?
Describe how you would ensure that database object definitions (tables, indices, constraints, triggers, users, logins, connection options, and server options etc)are consistent and repeatable between multiple database instances (i.e.: A test and production copy of a database)?
What is a partition?
What information is provided by .dbc file extension for connecting to the database?
What is flow buffering ? How it reduces the chances of having deadlock ? How to use in abinitio graph?
What are the steps to create a repository in ab initio?
What is the ab initio business rules environment (bre)?
Code check-in and check-out commands in AbInitio
What is the difference between look-up file and look-up, with a relevant example?
Mention what is a partition and what are the different types of partition components in abinitio?
What is data encoding?
Have you ever encountered an error called “depth not equal”?