/*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
What is the use of %include statement?
What are the different servers in sas? : sas-grid-administration
How do you add a number to a macro variable? : sas-macro
What does PROC print, and PROC contents do?
what is the effect of the options statement errors=1? : Sas programming
what is broad cast agent? : Sas-bi
what is data integration? : Sas-di
What are the prime responsibilities of data integration administrator? : Sas-di
State the difference between INFORMAT and FORMAT ?
which features do you use to check the data validations and errors? : Sas-administrator
explain the difference between proc means and proc summary?
What does proc print, and proc contents are used for?
What is your favorite all time computer book? Why?
explain what is factor analysis? : Sas-administrator
How do you specify the number of iterations and specific condition within a single do loop?