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
Mention some common errors that are usually committed in sas programming.
What is the use of function Proc summary?
How can you limit the variables written to output dataset in data step?
What is maximum number of rows and cols can be handled in SAS?
What is the difference between input and infile statement?
why is sas considered self-documenting? : Sas programming
explain the key concept of sas? : Sas-administrator
What is the different between functions and PROCs that calculate the same simple descriptive statistics?
What are the features of base sas system?
How do you control the number of observations and/or variables read or written? Approximately what date is represented by the SAS date value of 730?
What are the features of SAS?
What is program data vector (pdv) and what are its functions?
what are the new features included in the new version of sas i.e., Sas 9.1.3? : Sas programming
how do you want missing values handled? : Sas programming
How do you add a number to a macro variable? : sas-macro