Right, now you have provided some minimal explanation, the simplest action would be:
data main;
set sashelp.vtable (where=(libname="<yourlib>") keep=memname);
run;
proc sql;
create table sums (memname char(200),res num);
quit;
data _null_;
set sashelp.vcolumn (where=(libname="<yourlib>" and name="<thevartosum>"));
call execute('proc sql;
insert into sums
set memname="'||strip(memname)||'",
res=(select sum('||strip(name)||') from <yourlib>.'||strip(memname)||';
quit;');
run; data final; merge main sums; by memname; run;
What this does is select all dataset names from yourlib (note must by upcase). Then it selects from those datasets the ones containing the variable in question and for each one generates an insert into a main table. The main table is finally merged to these sums (as some datasets don't have the variable. If you only need the one with the sums then you can drop main and the merge at the end.
... View more