![]() Chapter Contents |
![]() Previous |
![]() Next |
| Array Reference |
| Valid: | in a DATA step |
| Category: | Information |
| Type: | Declarative |
Syntax |
| array-name { subscript } |
| Tip: | In this book, the subscript is enclosed in braces ( { } ). You can also use brackets ( [ ] ) or parentheses (( )). |
| Details |
![[cautend]](../common/images/cautend.gif)
array new{*} score1-score4; do i=1 to dim(new); new{i}=new{i}+10; end;
| Comparisons |
| Examples |
array days{7} d1-d7;
do i=1 to 7;
if days{i}=99 then days{i}=100;
end;
array days{7} d1-d7;
array hours{7} h1-h7;
do i=1 to 7;
if days{i}=99 then days{i}=100;
hours{i}=days{i}*24;
end;
array arr1{*} a1-a3;
x=1;
input a1 a2 arr1{x+2};
array cost{10} cost1-cost10; totcost=sum(of cost {*});
array days{7} d1-d7; input days {*};
array hours{7} h1-h7; put hours {*};
| See Also |
Statements
| |||||
Function:
| |||||
| Array Processing in SAS Language Reference: Concepts |
![]() Chapter Contents |
![]() Previous |
![]() Next |
![]() Top of Page |
Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.