Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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?

Answers were Sorted based on User's Feedback



In a shcool there are 1000 students. After completion of every test in 6 subjects , each subject t..

Answer / bakul shah

/*
Bakul Shah
6/May/2009
*/
Data A ;
Array N{6};
Input Name $ N{*} ;
Call SortN(of N{*}); /* Sort for Intergers */
Put @5 Name $ @10 N{6} 3. +2 N{5} 3.;/* 6th and 5th */
DataLines;
David 76 81 65 87 78 98
Manisha 100 91 67 86 87 81
Bob 83 93 76 88 96 72
;
Run;
*;

Is This Answer Correct ?    6 Yes 0 No

In a shcool there are 1000 students. After completion of every test in 6 subjects , each subject t..

Answer / 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

In a shcool there are 1000 students. After completion of every test in 6 subjects , each subject t..

Answer / 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

In a shcool there are 1000 students. After completion of every test in 6 subjects , each subject t..

Answer / santosh reddy

data x;
set rating;
max1=max(of a--f);
array aa(6) a--f;
do i=1 to 6;
if aa(i)>max2 and aa(i)<max1 then max2=aa(i);
end;
run;

Is This Answer Correct ?    0 Yes 0 No

In a shcool there are 1000 students. After completion of every test in 6 subjects , each subject t..

Answer / basha

just i imagine data in data base is;
like below output dataset:
data rating;
input name $ a b c d e f;
cards;
raj 1 54 21 5 7 2
jar 2 21 54 67 3 5
;
answer:

proc sort data=rating;
by name;
run;
proc transpose data=rating out=marks(rename=(col1=marks
_name_=subjects) drop=_label_);
by name;
run;
proc sort data=marks;
by descending marks name;
run;
data jj;
set marks;
by name;
if first.name then ind=0;
ind+1;
run;
proc print;
where ind in(1,2);
run;

Is This Answer Correct ?    2 Yes 3 No

In a shcool there are 1000 students. After completion of every test in 6 subjects , each subject t..

Answer / hahaha

proc sort data=marks;
by name descending marks ;/*for answer 2, just change the
order*/

Is This Answer Correct ?    0 Yes 2 No

Post New Answer

More SAS Interview Questions

I have a dataset with variables empid and doj how to calculate retirement age?

1 Answers  


how to delete the duplicates by using proc sql?

3 Answers   Genpact,


For a user to have access to a standard workspace server, is internal authentication alone is sufficient? : sas-grid-administration

0 Answers  


What is by-group processing?

0 Answers  


What is SAS? is it a software just for use or we can creat something over there?

5 Answers   Cognizant,


How do you debug macros?

3 Answers   Accenture,


What are the different types of sas functions?

0 Answers  


Do you need to combine data sets? How should you combine data sets– MERGE or SET statements in DATA steps,PROC APPEND,PROC SQL?

3 Answers  


Explain the special input delimiters used in sas programming.

0 Answers  


How would you remove a format that has been permanently associated with a variables?

3 Answers  


how many display types available in sas bi dashboard? : Sas-bi

0 Answers  


What sas features do you use to check errors and data validation?

0 Answers  


Categories