Scott's reply is the best in principle. However, accessing the dictionary can be very slow if you have many tables, especially if you have libraries pointing to RDBMS data.
To build a list from specific known tables, extracting table metadata directly is faster, if not as clean as querying the dictionary.
[pre]
%macro makevarlist(table, prefix);
%let varlist=;
%let dsid=%sysfunc(open(&table));
%do i = 1 %to %sysfunc(attrn(&dsid,nvars));
%let varname=%sysfunc(varname(&dsid,&i));
%if %substr(&varname,1,3)=&prefix %then %let varlist=&varlist &varname;
%end;
%let dsid=%sysfunc(close(&dsid));
%put &varlist;
%mend;
%makevarlist(sashelp.citiwk, WSP)