XLS files are much harder as there is no XLS libname engine to use.
1248 libname xls xls "c:\downloads\test_class.xls" ; ERROR: The XLS engine cannot be found. ERROR: Error in the LIBNAME statement.
If you are running on windows (and you can get it to work) you might be able to use the EXCEL libname engine instead.
If you want to only see the names of the variables in the datasets that have the string 'DATA' in their name then just subset the CONTENTS data.
proc print data=contents;
where memname like '%DATA%' ;
var memname varnum name;
run;
Figure it out for one and then figure out how to scale it.
If you assign a libname to the Excel file and then check the data tab does it have the column headers?
libname myxl 'path to xlsx file';
proc contents data=myxl.data;
run;
You can just use the XLSX engine to treat the workbook as a library of datasets.
The NAME of the variables will be derived from the headers in the first row of each sheet.
libname myfile xlsx 'myfile.xlsx';
proc contents data=myfile._all_ out=contents noprint; run;
proc print data=contents;
by memname;
id memname;
var varnum name label ;
run;
XLS files are much harder as there is no XLS libname engine to use.
1248 libname xls xls "c:\downloads\test_class.xls" ; ERROR: The XLS engine cannot be found. ERROR: Error in the LIBNAME statement.
If you are running on windows (and you can get it to work) you might be able to use the EXCEL libname engine instead.
If you want to only see the names of the variables in the datasets that have the string 'DATA' in their name then just subset the CONTENTS data.
proc print data=contents;
where memname like '%DATA%' ;
var memname varnum name;
run;
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.