From: montura on
"data step arrays are effectively limited to two dimensions."

"Effectively" is the key word in that posting.
I did not mention the number of variables that can be declared in any
dimension, just the number of dimensions.

Data step arrays are also patently slowwww.
SCL arrays are super fast.

I not splitting hairs, or saying that it's impossible. I am saying its
too easy to screw up the entire data step and its way to hard to
verify that a production program is working correctly, 5 years down
the road.

Is that a more acceptable elaboration?

:o)

From: TFriis on
On 27 Apr., 17:17, "Richard A. DeVenezia" <rdevene...(a)gmail.com>
wrote:
>
> Perhaps part of your problem is that the VBA code populates cells in a
> rectangle -- a table if you will.
> The code shown above populates a two dimensional array resulting in
> NxN columns in and output table having N rows.
>
> In order to create a table that looks like your matrix you will need
> to have N columns and N rows.
>
> ------------
> data vector;
> input Conc @@;
> cards;
> 12 13 14 15 16 17
> ;
> run;
>
> proc sql noprint;
>  select count(*)
>   into :COUNT
>   from work.vector;
> quit;
>
> data myMatrix;
>   array values(&count) _temporary_;
>   do _n_ = 1 to dim(values);
>     set vector;
>     values(_n_) = conc;
>   end;
>
>   array cell(&count);
>
>   do i = 1 to dim(values);
>     do j = 1 to dim(values);
>       if i = j then
>         cell(j) = 0;
>       else
>         cell(j) = values(i) * values(j);
>     end;
>     OUTPUT;
>   end;
>
>   format cell: 6.;
>   keep cell:;
> run;
> ------------
>
> Richard A. DeVenezia

Thanks to everybody here! This was excactly what I was looking for.

I really appreciate it, was going nuts for a while (new to SAS
programming). This was GREAT! Hopefully in a year or two, I'll master
this language...