Chapter Contents |
Previous |
Next |
DELARRAY |
Category: | Array |
Syntax | |
Details | |
Examples | |
Example 1: Create an Array and Delete It | |
See Also |
Syntax |
rc=DELARRAY(array); |
0 | successful |
0 | not successful |
Type: Numeric
Type: Array
Details |
The DELARRAY function deletes dynamic arrays. An array's contents cannot be accessed after the array is deleted. Dynamic arrays are only accessible within the scope that they are declared. In the following example, array B is not accessible outside of the scope of the DO group:
m1:method; DCL num a(*,*) rc; rc = makearray(a,5,5); do; DCL num b(*); rc = makearray(b,10); end; endmethod;
Examples |
The example creates a 1-dimensional array of 5 elements, resizes it to 10 elements (preserving the data), and deletes the array.
DCL num a(*); rc = makearray(a,3); do i=1 to dim(a); a[i]=i; end; rc = redim(a,5); put a=; rc = delarray(a);
The output would be:
a[1]=1 a[2]=2 a[3]=3 a[4]=. a[5]=.
See Also |
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.