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

/*i have the following dataset.*/

data score;
input marks ;
datalines;
10
20
30
40
50
60
70
80
90
100
;
run;

Now i should get the result as sum of 1 to 5 i.e(10+20+30+40+50)=150
and 2 to 6 i.e(20+30+40+50+60)=200
and 3 to 7 i.e(30+40+50+60+70)=250 and so on.
how to get it.
thanks in advance

Answer Posted / tandon

PROC TRANSPOSE DATA=SCORE OUT=SCORE2 NAME=SUBJECT PREFIX=MARKS;
VAR MARKS;
RUN;

PROC PRINT DATA=SCORE2;
RUN;

DATA SUM;
SET SCORE2;
A=SUM(OF MARKS1 - MARKS5);
B=SUM(OF MARKS2 - MARKS6);
C=SUM(OF MARKS3 - MARKS7);
D=SUM(OF MARKS4 - MARKS8);
E=SUM(OF MARKS5 - MARKS10);
RUN;
PROC PRINT DATA=SUM HEADING=H;
OPTIONS LS=150;
RUN;

Is This Answer Correct ?    1 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What does P-value signify about the statistical data?

1400


What are symget and symput? : sas-macro

1368


Mention what is the difference between nodupkey and nodup options?

1059


What is the role of administrative users? : sas-grid-administration

1136


Where do you use proc means over proc freq?

1188


explain about data integrator metadata reports? : Sas-di

1165


What is the purpose of _character_ and _numeric_?

1108


What system options would you use to help debug a macro? : sas-macro

1146


what are informats in sas? : Sas-administrator

1149


how do the in= variables improve the capability of a merge? : Sas programming

1481


why is sas considered self-documenting? : Sas programming

1187


What is the sas data set? : sas-grid-administration

1029


What are the ways in which macro variables can be created in sas programming?

1172


what is the difference between: x=a+b+c+d; and x=sum (of a, b, c ,d);? : Sas programming

1180


explain the proc in sas? : Sas-administrator

1131