![]() Chapter Contents |
![]() Previous |
![]() Next |
| SAS Component Language: Reference |
array month[5] jan feb mar apr may (1,2,3,4,5);
INIT:
do i=1 to 5;
sum+month[i];
end;
put month;
put sum=;
return;
The example produces the following output:
month[1] = 1 month[2] = 2 month[3] = 3 month[4] = 4 month[5] = 5 sum=15
The preceding DO block has the same effect as any one of the following assignment statements:
sum1=jan+feb+mar+apr+may; sum2=sum(of month[*]); sum3=sum(of jan--may); put sum1= sum2= sum3= ;This example produces the following output:
sum1=15 sum2=15 sum3=15
![]() Chapter Contents |
![]() Previous |
![]() Next |
![]() Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.