There are -many- previous forum postings on the use of the DICTIONARY information to perform tasks like this. In addition, you can search on Google for user group papers on the use of the DICTIONARY tables. Here's just one example.
** make table to use later;
create table work.shoecols as
where upcase(libname) = "SASHELP" and
upcase(memname) = "SHOES";