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 / ashutosh
slightly modified
data nrate;
set rating;
array r{6} a -- f;
do i=1 to 6;
*for first maximum;
if r{i}>max1 then
do
max2=max1;
max1=r{i};
end;
*for second maximum;
if r{i}>max2 and r{i}<max1 then max2=r{i};
end;
proc print data=nrate;
run;
| Is This Answer Correct ? | 3 Yes | 1 No |
Post New Answer View All Answers
How would you identify a macro variable? : sas-macro
How will you react when, while consulting a SAS documentation manual to get an answer to a problem, someone says hey, I thought you were supposed to know all that stuff already, and not have to look it up in a book?
Hi Friends, Am Priya,new to your forum. am looking for Interview questions on SAS Platform Administration. I searched everywhere but I couldn't find them,please can anyone help me with complete interview questions normally everyone will face in the interviews on SAS Administration. am really facing problems in the interviews,am not able to answer any of their questions. I would really appreciate all your help if you can email the complete Interview Questions to priyafeb84@gmail.com Kindly awaiting for your reply with eager
How to sort in descending order?
what is the one statement to set the criteria of data that can be coded in any step? : Sas programming
what is scheduling and how will u implement it. In scheduling 5 jobs r running if there is an error occured at 3rd job and how will u check and waht necessary steps will u take not to repeat the same mistake
What’s the difference between var b1 – b3 and var b1 — b3?
List out some key concept of SAS
what are sas/access and sas/connect? : Sas programming
Tell me about % include and % eval? : sas-macro
What do the PUT and INPUT functions do?
what is the primary data source for the wrs? : Sas-bi
what are _numeric_ and _character_ and what do they do? : Sas programming
please can you tell me that in companies sas work are doing by through sas coding or sas wizard ??
How can I remove header from output data set?