You can grab information from proc contents through ODS by using the correct ODS Table Name to query for the value you need, removing the need for a proc sql step. Here's an example that returns the Filename Chris is looking for in the first program sample: libname foo '<wherever>'; ods output enginehost=temp(keep=cvalue1 label1 where=(label1 = "Filename")); ods listing close; proc contents data=foo.<dataset>; run; ods listing; data _null_; set temp; put "Filename=" cvalue1; run; You can find the ODS Table Names in the Output Delivery System: User's Guide documentation.