libname apple 'C:\Users\Documents\Sales.xls'; proc print data = apple.Sales; where EmpID = '9888' or EmpID = '0177'; run;
@tianerhu wrote:
libname apple 'C:\Users\Documents\Sales.xls'; proc print data = apple.Sales; where EmpID = '9888' or EmpID = '0177'; run;
And what is your problem? If you get ERRORs or WARNINGs, post the log. Otherwise describe what does not work as intended.
thank you for your advice, sir , following is the information from log
2023
2024 libname apple 'C:\Users\Documents\Sales.xls';
ERROR: Connect: Class not registered
ERROR: Error in the LIBNAME statement.
2025
2026 proc print data = apple.Sales;
ERROR: Libref APPLE is not assigned.
2027 where EmpID = '9888' or EmpID = '0177';
WARNING: No data sets qualify for WHERE processing.
2028
2029 run;
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE PRINT used (Total process time):
real time 0.03 seconds
cpu time 0.01 seconds
Try adding the an engine to your LIBNAME:
libname apple XLS 'C:\Users\Documents\Sales.xls';
Your spreadsheet need to to contain a tab called Sales as well.
thank you , but it still does not work
spreadsheet need to to contain a tab called Sales as well.
what does that mean ?
yes ,the file " Sales.xls" in the C:\Users\Documents\Sales.xls' , it was there , and in the spreadsheet , just only one worksheet
thank you for your help , following is the information from log :
yes , my SAS is 64 byte, and the xls file is 32 byte , but i have install PC file server.
by the way , what's the name range?
2121
2122 libname apple XLS 'C:\Users\Documents\Sales.xls';
ERROR: The XLS engine cannot be found.
ERROR: Error in the LIBNAME statement.
2123
2124 proc print data = apple.Sales;
ERROR: Libref APPLE is not assigned.
2125 where EmpID = '9888' or EmpID = '0177';
WARNING: No data sets qualify for WHERE processing.
2126
2127 run;
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE PRINT used (Total process time):
real time 0.20 seconds
cpu time 0.00 seconds
Did you try using the PCFILES engine?
Have you ever gotten the PC Files Server to work?
thank you for your help .
yes , i try PCFILES,but it still doesn't work
i have installed the PC files server, when i use wizard import to invert the xls files to csv files , it works well
Named ranges are an Excel concept, they allow you to create a reference to a table without having a specific sheet.
What about the following:
libname apple pcfiles path= 'C:\Users\Documents\Sales.xls';
proc datasets lib=apple;
run;
@tianerhu wrote:
thank you for your help , following is the information from log :
yes , my SAS is 64 byte, and the xls file is 32 byte , but i have install PC file server.
by the way , what's the name range?
2121
2122 libname apple XLS 'C:\Users\Documents\Sales.xls';
ERROR: The XLS engine cannot be found.
ERROR: Error in the LIBNAME statement.
2123
2124 proc print data = apple.Sales;
ERROR: Libref APPLE is not assigned.
2125 where EmpID = '9888' or EmpID = '0177';
WARNING: No data sets qualify for WHERE processing.
2126
2127 run;NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE PRINT used (Total process time):
real time 0.20 seconds
cpu time 0.00 seconds
it works , but that is not what i want .
If the PCFILES engine works, please post your PROC DATASETS log. Does it list the worksheets in your Excel workbook?
Trying to print a table called Apple.Sales that is in an Excel workbook called Sales means you are referencing a worksheet within the workbook called Sales also. If your worksheet is not called Sales then your program will fail with an error - dataset not found.
thank you , but , it still doesn't work
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.