Arrays that are declared
in functions and CALL routines can be resized, as well as arrays that
are declared with the /NOSYMBOLS option. No other array can be resized.
The DYNAMIC_ARRAY CALL
routine attempts to dynamically resize the array to match the dimensions
of the target that you provide. This means that the array must be
dynamic. That is, the array must be declared either in a function
or subroutine, or declared with the /NOSYMBOLS option.
The DYNAMIC_ARRAY CALL
routine is passed the array to be resized and a new size for each
dimension of the array. In the ALLPERMK routine, a scratch array that
is the size of the number of elements being permuted is needed. When
the function is created, this value is not known because it is passed
in as parameter
n. A dynamic
array enables the routine to allocate the amount of memory that is
needed, instead of having to create an array that is large enough
to handle all possible cases.
When using dynamic arrays,
support is limited to PROC FCMP routines. When an array is resized,
the resized array is available only within the routine that resized
it. It is not possible to resize a DATA step array or to return a
PROC FCMP dynamic array to the DATA step.