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


Please Help Members By Posting Answers For Below Questions

How do you use the do loop if you don’t know how many times you should execute the do loop?

751


how many display types available in sas bi dashboard? : Sas-bi

639


Difference between nodup and nodupkey options?

631


What is the use of stop statement?

642


What does the trace option do?

663






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

4912


Explain what Proc glm does?

633


Enlist the functions performed by sas.

674


what is data access? : Sas-di

605


what are all the reports you generated in your recent project?

1679


Do you need to know if there are any missing values?

595


why is a stop statement needed for the point=option on a set statement? : Sas programming

583


how does sas handle missing values in functions? : Sas programming

599


Difference between informat and format?

638


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?

701