0% found this document useful (0 votes)
62 views1 page

SAS Data Summation Examples

The document contains 3 programs that incrementally add values to a variable called "sum". The first program adds the numbers 1 through 10 to sum. The second program uses a do loop to add the numbers 1 through 100 to sum. The third program uses a do loop to add the numbers from 1 to 100, incrementing by 2 each time, to sum. Each program prints the results.

Uploaded by

Deepesh Shenoy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
62 views1 page

SAS Data Summation Examples

The document contains 3 programs that incrementally add values to a variable called "sum". The first program adds the numbers 1 through 10 to sum. The second program uses a do loop to add the numbers 1 through 100 to sum. The third program uses a do loop to add the numbers from 1 to 100, incrementing by 2 each time, to sum. Each program prints the results.

Uploaded by

Deepesh Shenoy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

data add;

sum=0;
sum+1;
sum+2;
sum+3;
sum+4;
sum+5;
sum+6;
sum+7;
sum+8;
sum+9;
sum+10;
run;
proc print data=add;
run;

data add2;
sum=0;
do time = 1 to 100;
sum+time;
output;
end;
run;
proc print data=add2;
run;

data add3;
sum=0;
do time = 1 to 100 by 2;
sum+time;
output;
end;
run;
proc print data=add3;
run;

You might also like