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
what is enterprise guide? What is the use of it? : Sas programming
what is the use of sas management console? : Sas-di
What are the difficulties u faced while doing vital signs table or dataset?
Name types of category in which SAS Informats are placed?
For what purposes have you used sas macros? : sas-macro
How sas treats the dsd delimiters?
Explain why double trailing @@ is used in input statement?
How to create list output for cross-tabulations in proc freq?
Explain data step in SAS
how does sas handle missing values in: assignment statements, functions, a merge, an update, sort order, formats, procs? : Sas programming
what is broad cast agent? : Sas-bi
what are the considerations when picking a SAS/STAT procedure?
How long can a macro variable be? A token? : sas-macro
How is character variable converted into numeric variable and vice versa?
What is the order of application for output data set options, input data set options and SAS statements?