how to get second highest salary from a employee table and
how get a 5th highest salary from a employee table?

Answers were Sorted based on User's Feedback



how to get second highest salary from a employee table and how get a 5th highest salary from a empl..

Answer / richa

It can be done by first sorting the dataset in the
ascending order of salary and then using the 'point='
option.

For eg:

proc sort data = x;
by salary;
quit;

/*second highest salary*/
data y;
a = 2;
set x point = a;
stop;
run;

/*fifth highest salary*/
data y;
a = 5;
set x point = a;
stop;
run;

Is This Answer Correct ?    1 Yes 9 No

Post New Answer

More SAS Interview Questions

1 new york 7,262,700 2 los angeles 3,259,340 3 philadelphia 1,642,900 how to read the above data using input statement consider the above data is in txt format externally u have to use infile and input statement.

9 Answers   Quintiles,


Explain append procedure?

0 Answers  


create macros---you have 365 number of data and you need to merge it throw the macros,,,,,, data file1; input a @@; cards; 1 2 3 4 ; run; data file2; input a @@; cards; 5 6 7 8 ; run; data file3; input a @@; cards; 9 10 11 12 ; run;data file4; input a @@; cards; 13 14 15 16 ; run;

6 Answers   WNS,


in the flow of data step processing, what is the first action in a typical data step? : Sas programming

0 Answers  


Which command is used to perform sorting in sas program?

0 Answers  






why a stop statement is needed for the point= option on a set statement?

0 Answers  


What is difference between rename and lable in sas?

10 Answers   Satyam,


data jagan1.s; input bp$; cards; 100/90 120/89 112/87 run; in the above code how to convert character data values to numeric data values?

3 Answers  


What is run-group processing?

0 Answers  


what is the effect of the options statement errors=1? : Sas programming

0 Answers  


What are the rows present in protocol Violation table?

2 Answers   Accenture, Quintiles,


What are the criticality that you have faced during your project in SAS?

2 Answers  


Categories