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 / naveen kumar

proc transpose data=score out=score2 prefix= mark;
var marks;
quit;

data score2;
set score2;
sum1=sum(mark1,mark2,mark3,mark4,mark5);
sum2=sum(mark2,mark3,mark4,mark5,mark6);
sum3=sum(mark3,mark4,mark5,mark6,mark7);
sum4=sum(mark4,mark5,mark6,mark7,mark8);
sum5=sum(mark5,mark6,mark7,mark8,mark9);
sum6=sum(mark6,mark7,mark8,mark9,mark10);
run;

Is This Answer Correct ?    4 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

If a variable contains only numbers, can it be a character data type?

1036


how would you create a data set with 1 observation and 30 variables from a data set with 30 observations and 1 variable? : Sas programming

1279


what are the softwares and applications that are used most frequently used by sas bi applications developers? : Sas-bi

970


what are the considerations when picking a SAS/STAT procedure?

3329


Explain the main difference between the sas procedures and functions? : Sas-administrator

1018


How can you create a macro variable with in data step? : sas-macro

988


How would you determine the number of missing or nonmissing values in computations?

1015


How would you code a merge that will write the matches of both to one data set, the non-matches from the left-most data?

1058


What are the statements that are executed only?

1100


what are the scrubbing procedures in sas? : Sas programming

1229


What versions of SAS have you used (on which platforms)?

1462


Briefly explain input and put function?

1034


what are 5 ways to perform a table lookup in sas? : Sas-administrator

1183


What do you know about symput and symget?

1165


How would you define the end of a macro? : sas-macro

1041