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...

Below is the table.









Required to be output should be the highest number of each student_id.
Example.
Student_id Subject Marks
1 Hindi 86
2 Hindi 70
3 English 80
.

Calculate sum and average marks for each group of student_id
Example.
Student_id Subject Marks Total Marks Average
1 English 40 181 60.33333
2 English 67 196 65.33333
3 English 80 160 53.33333

PLEASE PROVIDE THE CODE OF ABOVE PROBLEMS

Answer Posted / chaudhary_1989

data a;
input id sub$ marks;
cards;
1 Hindi 86
2 Hindi 70
3 Hindi 80
1 English 80
2 English 34
3 English 39
1 Maths 28
2 Maths 45
3 Maths 12
;
run;

proc sort data = a out=b;
by id descending marks;
run;

data c (drop=total_marks) d;
set b;
by id descending marks;
if first.id then output c;
if first.id then total_marks=marks;
else total_marks+marks;
if last.id then output d;
run;

proc print; run;

proc means data = a mean max sum;
class id;
var marks;
output out=df;
run;

proc means data = a noprint nway;
class id;
var marks;
output out=df sum= mean= max= /autoname;
run;

proc print; run;

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Are you involved in writing the inferential analysis plan? Tables specfications?

2561


What is substr function?

1175


why is a stop statement needed for the point=option on a set statement? : Sas programming

1076


which date functions advances a date time or date/time value by a given interval? : Sas programming

941


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

1068


name several ways to achieve efficiency in your program? : Sas programming

1057


In proc transpose and data step with arrays which one you pick?

3101


what is the difference between unique key and primary key? : Sas-di

1121


Tell me more about the parameters in macro? : sas-macro

1049


Describe the ways in which you can create macro variables? : sas-macro

1059


To what type of programms have you used scratch macros?

2560


Explain why double trailing @@ is used in input statement?

1052


what is operational data and operational system? : Sas-di

1102


what do the mod and int function do? What do the pad and dim functions do? : Sas programming

1159


What do the mod and int function do? : Sas programming

1210