In a shcool there are 1000 students. After completion of
every test in 6 subjects , each subject teacher submit the
marks of every student at different times and loaded in the
database commonly. How will you seperate the top two
subject marks for each each studet using SAS?

Answer Posted / basha

just i imagine data in data base is;
like below output dataset:
data rating;
input name $ a b c d e f;
cards;
raj 1 54 21 5 7 2
jar 2 21 54 67 3 5
;
answer:

proc sort data=rating;
by name;
run;
proc transpose data=rating out=marks(rename=(col1=marks
_name_=subjects) drop=_label_);
by name;
run;
proc sort data=marks;
by descending marks name;
run;
data jj;
set marks;
by name;
if first.name then ind=0;
ind+1;
run;
proc print;
where ind in(1,2);
run;

Is This Answer Correct ?    2 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what is enterprise guide? What is the use of it? : Sas programming

538


what is the use of sas management console? : Sas-di

613


What are the difficulties u faced while doing vital signs table or dataset?

1933


Name types of category in which SAS Informats are placed?

736


For what purposes have you used sas macros? : sas-macro

540






How sas treats the dsd delimiters?

720


Explain why double trailing @@ is used in input statement?

572


How to create list output for cross-tabulations in proc freq?

620


Explain data step in SAS

631


how does sas handle missing values in: assignment statements, functions, a merge, an update, sort order, formats, procs? : Sas programming

598


what is broad cast agent? : Sas-bi

593


what are the considerations when picking a SAS/STAT procedure?

2899


How long can a macro variable be? A token? : sas-macro

717


How is character variable converted into numeric variable and vice versa?

596


What is the order of application for output data set options, input data set options and SAS statements?

1080