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

Mention some common errors that are usually committed in sas programming.

588


What is the use of function Proc summary?

653


How can you limit the variables written to output dataset in data step?

754


What is maximum number of rows and cols can be handled in SAS?

853


What is the difference between input and infile statement?

684






why is sas considered self-documenting? : Sas programming

682


explain the key concept of sas? : Sas-administrator

559


What is the different between functions and PROCs that calculate the same simple descriptive statistics?

1229


What are the features of base sas system?

613


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?

1161


What are the features of SAS?

577


What is program data vector (pdv) and what are its functions?

631


what are the new features included in the new version of sas i.e., Sas 9.1.3? : Sas programming

545


how do you want missing values handled? : Sas programming

534


How do you add a number to a macro variable? : sas-macro

545