Nice. I changed where libname="&ref_lib" and memname="&ref_table" to where libname="%sysfunc(upcase(&ref_lib))" and memname="%sysfunc(upcase(&ref_table))" so that I don't have to remember to put the library and dataset names in upper case.