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 are _numeric_ and _character_ and what do they do? : Sas programming
what is the difference between: x=a+b+c+d; and x=sum (of a, b, c ,d);? : Sas programming
Why double trailing @@ is used in input statement?
What is the basic syntax style in SAS?
What do you code to create a macro? : sas-macro
What is the general format of function in sas? : sas-grid-administration
How do you connect the desktop application to metadata server? : sas-grid-administration
Name few SAS functions?
what is the difference between floor and ceil functions in sas? : Sas-administrator
What is the work of tranwrd function?
what is broad cast agent? : Sas-bi
: and & modifiers.
how does sas handle missing values in functions? : Sas programming
For what purposes have you used sas macros? : sas-macro
What can be the size of largest dataset in SAS?