Hello,
Im new to SAS university and have been having this issue. I successfully assigned the library but can't get proc contents to work. There is a custfm.xls file in my folder. Sorry if this is trivial and thank you.
XLSX seems buggy for that to be honest. But you've also used XLSX to connect to an XLS file which isn't correct. Try changing it to EXCEL, except I'm not sure that works in SAS UE. Can you try saving your file as XLSX and try again?
Your approach is correct, and I can confirm that it does work in SAS UE.
So the issue is likely the file itself or the file type specified.
@goldenflash wrote:
Hello,
Im new to SAS university and have been having this issue. I successfully assigned the library but can't get proc contents to work. There is a custfm.xls file in my folder. Sorry if this is trivial and thank you.
XLSX seems buggy for that to be honest. But you've also used XLSX to connect to an XLS file which isn't correct. Try changing it to EXCEL, except I'm not sure that works in SAS UE. Can you try saving your file as XLSX and try again?
Your approach is correct, and I can confirm that it does work in SAS UE.
So the issue is likely the file itself or the file type specified.
@goldenflash wrote:
Hello,
Im new to SAS university and have been having this issue. I successfully assigned the library but can't get proc contents to work. There is a custfm.xls file in my folder. Sorry if this is trivial and thank you.
Hi,
Thank you for your reply. I've tried saving as xlxs but I still get the same log output. I've attached copies (an xls and xlxs file) of my excel so that you can check if there is a problem with the excels. Thank you for your time.
Code for your convenience:
LIBNAME custfm XLSX '/folders/myfolders/dataset/custfm.xlsx';
proc contents data=custfm._all_;
run;
What happens if you try and import the data?
What happens if you open the library in SAS, via point and click?
Hi,
Sorry, the xlxs file was saved in the wrong folder but saving it as a xlxs solved the problem. I have another issue while creating a temporary SAS file. when I use data and set, I get another error saying it couldn't find the spreadsheet. Sorry for the question after question, but I've been trying to get this to work. Thank you.
Change to :
set custfm.males;
Not - 'males$'n
When the name is not a sas valid name you can use 'not valid'n format.
The $ sign - use only if it is part of the sheet name.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.