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 to specify variables to be processed by the freq procedure?
what is the difference between infile and input? : Sas-administrator
which date function advances a date, time or datetime value by a given interval? : Sas programming
How might you use MOD and INT on numeric to mimic SUBSTR on character Strings?
how to create the AE dataset by using SDTMIG specifications and SAP plan by using UNIX platform?
What does the RUN statement do?
Did you used proc test? when?
what is information maps?
What are the functions used for character handling?
explain the proc in sas? : Sas-administrator
hi tell be about pfizer? how to compare the work with other companies ? please tell me how to login and work also?
What is factor analysis?
In sas admin differentiate between roles and capabilities? : sas-grid-administration
How can you create a macro variable with in data step? : sas-macro
what do the mod and int function do? What do the pad and dim functions do? : Sas programming