BookmarkSubscribeRSS Feed
tianerhu
Pyrite | Level 9
libname apple    'C:\Users\Documents\Sales.xls';

proc print  data = apple.Sales;
   where EmpID = '9888' or EmpID = '0177';

run;

10 REPLIES 10
ghosh
Barite | Level 11
libname apple excel   'C:\Users\Documents\Sales.xls';
ghosh
Barite | Level 11

what is the error message?

 

Can you try with an xlsx file format?

 

libname apple XLSX   'C:\Users\Documents\Sales.xlsx';
ballardw
Super User

@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.

tianerhu
Pyrite | Level 9

thank you for your help , i will reply the next week , i have to prepare the midterm

ed_sas_member
Meteorite | Level 14

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;

SAS Innovate 2025: Register Now

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!

What is Bayesian Analysis?

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 10 replies
  • 1215 views
  • 1 like
  • 5 in conversation