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

What is Transaction...? And what are Comment, Roll back n Save point..?

2 Answers  


How does the internal authentication work in sas? : sas-grid-administration

0 Answers  


What is LOGICAL VARIABLES in SAS.And how it can be used..Can anyone support..???

3 Answers  


How would you include common or reuse code to be processed along with your statements?

5 Answers   PSCI,


Hello, I have PROC SQLs results group by 3 fields and I use SUM and COUNT functions in SQL. The problem is when I try to display my result with PROC TABULATE. I am getting very big numbers. I believe I make a mistake some where in Tabulate. Here is my Proc Tabulate. PROC TABULATE DATA=OUT04_05 FORMAT=12.; CLASS YR CENTRE VISA / PRELOADFMT EXCLUSIVE; VAR NEWUSER FRAUD TRANSFER AUTUSER REISSUE; TABLE CENTRE ALL, (YR ALL)*VISA, (NEWUSER*F=COMMA12. AUTUSER*F=COMMA12. FRAUD*F=COMMA12. TRANSFER*F=COMMA12. REISSUE*F=COMMA12.) / MISSTEXT={LABEL='0'} PRINTMISS RTS=20; FORMAT VISA VISAFMT.; KEYLABEL SUM = ' ' ALL = 'TOTAL'; LABEL YR = 'DATE YEAR' NEWUSER = 'TOTAL NEW ACCT' TRANSFER = 'TOTAL TRANSFER' FRAUD = 'TOTAL FRAUD TRANSFER' AUTUSER = 'TOTAL AUTH USERS' REISSUE = 'TOTAL REISSUE'; When I code it like : NEWUSER*N*F=COMMA12. AUTUSER*N*F=COMMA12. I get same amount numbers but to find a NEWUSER I use COUNT(*) and to find AUTUSER I use SUM(xxxx) function so both result shouldn’t be the same my problem is in this point. Could you tell me where the problem in code is. How can I display my result? TX.

0 Answers  






Do you use PROC REPORT or PROC TABULATE? Which do you prefer? Explain.

3 Answers  


How to save the log information in a file for future use

2 Answers   HCL,


whenever we using the merging through data set merging ,we can get note in log like this "MERGE STATEMENT HAS MORE THAN ONE ONE DATASET BY REPEATED BY VAIABLES" but the output has come in good manner,whenever in in sql(full join) we can get cartion product.so How do overcome this problem in sql?

1 Answers   Accenture,


How do dates work in sas?

0 Answers  


what is data governance? : Sas-di

0 Answers  


What is the purpose of _character_ and _numeric_?

0 Answers  


Explain what is the use of proc gplot?

0 Answers  


Categories