How to get second top scorer student from a class- table
having different sections A, B, C & D? each section has same
number of student.

Answers were Sorted based on User's Feedback



How to get second top scorer student from a class- table having different sections A, B, C & D?..

Answer / maddy

proc sql;
select max(score) < (select max(score) from table)

from table;
quit;

Is This Answer Correct ?    3 Yes 0 No

How to get second top scorer student from a class- table having different sections A, B, C & D?..

Answer / partha

proc rank data=emp descending ties=dense out=s(where=(inc=1));
by deptno ;
var sal;
ranks inc;
run;
quit;

Is This Answer Correct ?    1 Yes 0 No

How to get second top scorer student from a class- table having different sections A, B, C & D?..

Answer / wkm

proc sort data=table;
by section descending score;
run;

data table2;
retain tot 0;
set table;
by section descending score;

if first.section then tot=1;
tot+1;

if tot=2;
run;

Is This Answer Correct ?    1 Yes 0 No

How to get second top scorer student from a class- table having different sections A, B, C & D?..

Answer / chandu

DATA ONR;
INPUT
@1 a
@3 b
@5 c
@7 d
;
SUM_VALUE =SUM (A, B, C, D);
RUN;
PROC SORT DATA=ONE NODUPKEY;
BY SUM_VALUE;
RUN;
DATA ONE_RESULT;
SET SUM;
IF _N_ = 2 THEN OUTPUT;
RUN;

Is This Answer Correct ?    1 Yes 2 No

Post New Answer

More SAS Interview Questions

why only we use SAS? their r many programmin language like SPSS, Oracle... Why SAS?

2 Answers   Accenture,


how to handle in stream data containing semicolon in it?

3 Answers  


What are all the problems you faced while validating tables and reports?

0 Answers   Accenture, Quintiles,


What can be the size of largest dataset in SAS?

0 Answers  


how are numeric and character missing values represented internally? : Sas programming

0 Answers  






Describe the types of SAS programming tasks that you performed like Tables? Listings? Graphics? Ad hoc reports? Other?

4 Answers   HP, Oracle,


what do you mean by data staging area? : Sas-di

0 Answers  


Mention common programming errors committed in sas ?

0 Answers  


What do you feel about hardcoding?

3 Answers   Pfizer,


how to add distinctly var variable values ex.. Data a; input var; datalines; 0 1 2 3 -1 -2 -3 ; run; adding all +ve value in one varibale n do the same for -ve too

5 Answers   CTS,


Which of the following is not created during compilation phase?

2 Answers   SAS,


what other SAS features do you use for error trapping and data validation?

3 Answers   Quintiles,


Categories