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 do you use the do loop if you don’t know how many times you should execute the do loop?
how many display types available in sas bi dashboard? : Sas-bi
Difference between nodup and nodupkey options?
What is the use of stop statement?
What does the trace option do?
hi all, I need the SAS DI DUMP(A00 260) for attending the certification. if any one have, pls provide it.Please Email to vrpotluri@hotmail.com. Thanks - Ramana
Explain what Proc glm does?
Enlist the functions performed by sas.
what is data access? : Sas-di
what are all the reports you generated in your recent project?
Do you need to know if there are any missing values?
why is a stop statement needed for the point=option on a set statement? : Sas programming
how does sas handle missing values in functions? : Sas programming
Difference between informat and format?
If you have a dataset that contains 100 variables, but you need only five of those, what is the code to force SAS to use only those variables?