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 / ashokmudrathi
data rating;
input a b c d e f;
cards;
1 54 21 5 7 2
2 21 54 67 3 5
;
*here 1000 observations with above variables;
data nrate;
set rating;
array r{6} a -- f;
do i=1 to 6;
*for first maximum;
if r{i}>max1 then max1=r{i};
*for second maximum;
if r{i}>max2 and r{i}<max1 then max2=r{i};
end;
proc print;
run;
| Is This Answer Correct ? | 4 Yes | 3 No |
Post New Answer View All Answers
How many data types are there in SAS?
What is SAS informats?
What are the different servers in sas? : sas-grid-administration
Did you used proc test? when?
What is a macro routine?
How are numeric and character missing values represented internally?
How do you test for missing values?
How does SAS handle missing values in: assignment statements, functions, a merge, an update, sort order, formats, PROCs?
For what purposes have you used sas macros? : sas-macro
what do you mean by data staging area? : Sas-di
Difference between SAS STATA & SPSS?
what are the best practices to process the large data sets in sas programming? : Sas-administrator
This entry was posted in General. Bookmark the permalink. Post a comment or leave
what are 5 ways to perform a table lookup in sas? : Sas-administrator
Tell me more about the parameters in macro? : sas-macro