I'm always doing this. This particular way I can have data set options applied to each dataset.
.
procsqlnoprint; select compress(libname || "." ||memname||' &DSoptions.') into: datasets separated by ' ' from Dictionary.tables where libname="LIBNAME" ; *<-- needs to be all caps; quit;