From: TFriis on
Hey.

I would like to sum all observations and all variables into one
figure. I have a table with an unknown amount of variables and unknown
variable_names and an unknown number of observations.

I would like the total sum of all variables and all observations in
this table (they are all numeric, and they all contain a number).

I have tried different approaches with proc means, but nothing seems
to help - hope you people out there can.

(sample code woudl be appreaciated).
From: data _null_; on
On Apr 28, 6:06 am, TFriis <t.fr...(a)gmail.com> wrote:
> Hey.
>
> I would like to sum all observations and all variables into one
> figure. I have a table with an unknown amount of variables and unknown
> variable_names and an unknown number of observations.
>
> I would like the total sum of all variables and all observations in
> this table (they are all numeric, and they all contain a number).
>
> I have tried different approaches with proc means, but nothing seems
> to help - hope you people out there can.
>
> (sample code woudl be appreaciated).

data grandTotalSum(keep=GrandTotalSum);
set sashelp.shoes(keep=_numeric_) end=eof;
array _n[*] _numeric_;
GrandTotalSum + sum(of _n[*]);
if eof then output;
run;

You need to look up in the documentation the "SAS Variable List" and
the ARRAY statement and how the ARRAY can be used as a "SAS Variable
List"