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
What are the default statistics for means procedure?
explain the key concept of sas? : Sas-administrator
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
What are the difficulties u faced while doing vital signs table or dataset?
I have a dataset concat having a variable a b & c. How to rename a b to e & f?
What does the RUN statement do?
What is the difference between %local and %global? : sas-macro
How do you specify the number of iterations and specific condition within a single do loop?
what do the mod and int function do? What do the pad and dim functions do? : Sas programming
How do you add a number to a macro variable? : sas-macro
What are the differences between sum function and using “+” operator?
Difference between SAS STATA & SPSS?
I have a SCD Type 2 Dimention for Location In which A Sales Office in Having two Surrogate Keys just because of the change in it's Sales Group. SKey SalesGroup Sales Office BeginDate EndDate 280 SG1 SO1 01APR2000 01APR2010 281 SG2 SO1 02APR2010 31MAR2999 Now while loading the Fact, the Lookup ir returning SKey 280 for records before and after 01APR2010. I am not able to give WHERE condition in the Lookup Properties (TranDate between BeginDate and EndDate). Please help.
how to create the AE dataset by using SDTMIG specifications and SAP plan by using UNIX platform?
What are SAS/ACCESS and SAS/CONNECT?