BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
goldenflash
Fluorite | Level 6

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.

sAS excel.PNG

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

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.

sAS excel.PNG


 

View solution in original post

8 REPLIES 8
Reeza
Super User

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.

sAS excel.PNG


 

goldenflash
Fluorite | Level 6

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;

sAS excel.PNG

 

Reeza
Super User

What happens if you try and import the data? 

What happens if you open the library in SAS, via point and click?

goldenflash
Fluorite | Level 6

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.

sAS excel.PNG

Shmuel
Garnet | Level 18

Change to : 

     set custfm.males;

Not -  'males$'n

goldenflash
Fluorite | Level 6
Alright, thx I got it working. I was taught to use $ sign and n, is this only needed when you are using it for non universiy edition?
Shmuel
Garnet | Level 18

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.

goldenflash
Fluorite | Level 6
Thank you. I got everything to work.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 8 replies
  • 3067 views
  • 3 likes
  • 3 in conversation