BookmarkSubscribeRSS Feed
tianerhu
Pyrite | Level 9

tianerhu_0-1621006011069.png

options validvarname=any;
libname apple 'C:\Users\liaodong\Documents\My SAS Files\Wages.xls';
proc means data = apple.'Permanent$'n mean;
var wage;
run;

message in log:

39 options validvarname=any;
40 libname apple xlsx 'C:\Users\liaodong\Documents\My SAS Files\Wages.xls';
ERROR: Invalid physical name for library APPLE.
ERROR: Error in the LIBNAME statement.
41 proc means data = apple.'Permanent$'n mean;
ERROR: Libref APPLE is not assigned.
42 var wage;
ERROR: No data set open to look up variables.
43 run;

NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE MEANS used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds

 

17 REPLIES 17
PaigeMiller
Diamond | Level 26
40 libname apple xlsx 'C:\Users\liaodong\Documents\My SAS Files\Wages.xls';
ERROR: Invalid physical name for library APPLE.
ERROR: Error in the LIBNAME statement.

The file does not exist. You have used the wrong file name or folder name (or both).

--
Paige Miller
tianerhu
Pyrite | Level 9

tianerhu_0-1621006723412.png

 

PaigeMiller
Diamond | Level 26

You screen capture is too small to read.

 

Also, for .XLS files, I think you need to use the EXCEL engine and not the XLSX engine.

--
Paige Miller
tianerhu
Pyrite | Level 9

tianerhu_0-1621007127481.png

The excel engine doesn't work .

 

PaigeMiller
Diamond | Level 26

@tianerhu wrote:

tianerhu_0-1621007127481.png

The excel engine doesn't work .

 


Saying it "doesn't work" is not helpful. Show us the LOG (including the actual code and any ERROR messages) you are using that doesn't work.

--
Paige Miller
tianerhu
Pyrite | Level 9
options validvarname=any;
libname apple 'C:\Users\liaodong\Documents\My SAS Files\Wages.xls';
proc means data = apple.'Permanent$'n mean;
var wage;
run;

message in log:

39 options validvarname=any;
40 libname apple xlsx 'C:\Users\liaodong\Documents\My SAS Files\Wages.xls';
ERROR: Invalid physical name for library APPLE.
ERROR: Error in the LIBNAME statement.
41 proc means data = apple.'Permanent$'n mean;
ERROR: Libref APPLE is not assigned.
42 var wage;
ERROR: No data set open to look up variables.
43 run;

NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE MEANS used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds

PaigeMiller
Diamond | Level 26

You left out the ENGINE name

 

libname apple excel 'C:\Users\liaodong\Documents\My SAS Files\Wages.xls';
--
Paige Miller
tianerhu
Pyrite | Level 9

I have try it , doesn't work.

PaigeMiller
Diamond | Level 26

@tianerhu wrote:

I have try it , doesn't work.


As I stated before (and I shouldn't have to ask multiple times), SHOW US THE LOG.

--
Paige Miller
tianerhu
Pyrite | Level 9

Thank you for your help.

ballardw
Super User

Which version of SAS are you using? SAS University Edition requires files to be in the shared folder set up when installed and does not use Windows file syntax because it runs in a virtual machine using UNIX/Linux file syntax.

 

If you are connecting to server then the server does not see your local hard drive and the file needs to be moved to where the server can see it.

 

If using SAS On Demand For Academics that is a server version and needs to have the file uploaded to be used.

tianerhu
Pyrite | Level 9

Thank you for your help.

ballardw
Super User

@PaigeMiller wrote:

You screen capture is too small to read.

 

Also, for .XLS files, I think you need to use the EXCEL engine and not the XLSX engine.


And a license for SAS/Access Interface to PC File formats

 

If you run this code:

Proc setinit;
run;

And the LOG does not show something similar to

---SAS/ACCESS Interface to PC Files

then you do not have a license and need one.

 

tianerhu
Pyrite | Level 9

but the context in the book do not tell  like things  about SAS/PC format file ?

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 17 replies
  • 2933 views
  • 3 likes
  • 4 in conversation