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 the command used to find missing values?
How is character variable converted into numeric variable and vice versa?
i want for interview question & answer plz it need immediate send t my mail raviprakashmot@gmal.cm
explain about data integrator metadata reports? : Sas-di
To what type of programms have you used scratch macros?
Give e an example of..
Tell e how how dealt with..
Explain data step in SAS
Can you execute macro within another macro? If so, how would sas know where the current macro ended and the new one began? : sas-macro
What is PDV?
Which date function advances a date, time or datetime value by a given interval?
what is SAS OPTIMIZATION?
How to import multiple xls files into sas. Out of those files, how to get different values from a single variable and how to find number of rows per value type? We can do this using group by for one xls file with proc sql. Was wondering how I can achieve this for multiple files at the same time. Any ideas?
What commands are used in the case of including or excluding any specific variables in the data set?
How do you debug and test your SAS programs?