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;
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
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.