BookmarkSubscribeRSS Feed
KK_QQ
Calcite | Level 5

I am using SAS University Edition. I tried to using below statment to access excel file

libname prod xlsx "/folders/myfolders/SAS/book1.xlsx";

Actually there is no error in log. But I can only see the prod libref is created but there is no way to access the data in the Excel file. 

 

I attach the book1 file, from sheet2 you can see the result from proc contents, there is connection, but can't read data. 

8 REPLIES 8
KK_QQ
Calcite | Level 5

Import is working. But I feel it works more like input, create new dataset. Not like libname create a link to file. 

KK_QQ
Calcite | Level 5
Sorry, I mean infile
Reeza
Super User

How did you try and 'read' the file. Did that generate an error? Include your code and log. 

KK_QQ
Calcite | Level 5
 libname prod xlsx "/folders/myfolders/SAS/book1.xlsx";
Log
1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
55
56 libname prod xlsx "/folders/myfolders/SAS/book1.xlsx";
NOTE: Libref PROD was successfully assigned as follows:
Engine: XLSX
Physical Name: /folders/myfolders/SAS/book1.xlsx
57
58 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
70
Reeza
Super User

Did you try accessing the data with a data step? Post that code

KK_QQ
Calcite | Level 5

No, I can't. After I use libname, there have libref created, but it empty, there is no data.

Reeza
Super User

How do you know it's empty? 

Did you try a data step? 

 

Data want;

set libname.'Sheet1$'n;

run;

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
  • 969 views
  • 0 likes
  • 3 in conversation