libname apple 'C:\Users\Documents\Sales.xls';
proc print data = apple.Sales;
where EmpID = '9888' or EmpID = '0177';
run;
libname apple excel 'C:\Users\Documents\Sales.xls';
thank you , but it doesn't work
what is the error message?
Can you try with an xlsx file format?
libname apple XLSX 'C:\Users\Documents\Sales.xlsx';
thank you , but it doesn't work
As I wrote in the other thread, run proc setinit and proc productstatus to verify that ACCESS to PC Files is licensed and installed.
@tianerhu wrote:
thank you , but it doesn't work
Doesn't work is awful vague.
Are there errors in the log?: Post the code and log in a code box opened with the {i} to maintain formatting of error messages.
No output? Post any log in a code box.
Unexpected output? Provide input data in the form of data step code pasted into a code box, the actual results and the expected results. Instructions here: https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat... will show how to turn an existing SAS data set into data step code that can be pasted into a forum code box using the {i} icon or attached as text to show exactly what you have and that we can test code against.
thank you for your help , i will reply the next week , i have to prepare the midterm
Hi @tianerhu
In case you don't have the license mentioned by @Kurt_Bremser , an alternative could be the use of PROC IMPORT:
proc import datafile='C:\Users\Documents\Sales.xls'
out=work.Sales /* 'work' or any other library*/
dbms=xls
replace;
run;
proc print data = work.Sales; /* 'work' or any other library*/
where EmpID = '9888' or EmpID = '0177';
run;
All uses of the excel/xls/xlsx/excelcs engines require that ACCESS to PC Files is licensed and installed.
Thank you so much .
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.
Ready to level-up your skills? Choose your own adventure.