Hi,
I'm trying to get an excel file in my SAS with the help of libname but it is giving error to me. I'm writing a sample code for reference.
libname A '/folders/myshortcuts/SAS program/Passenger.xls';
I'm using SAS studio.
Please help me out in this
@Swati24 wrote:
Yes I'm using SAS Studio university Edition
In that case, you need to convert your Excel workbook to the xlsx format, as the Engines for the older xls files are only available on Windows (University Edition runs on a Linux virtual machine).
Could you please give us more details which dataset you have used.
The approach of generating the excel file is incorrect in your case.
you can use the proc export procedure to generate the excel file.
an example is below
proc export
data=sashelp.prdsale
dbms=xlsx
outfile="c:\temp\prdsale.xlsx"
replace;
run;
source: https://blogs.sas.com/content/sasdummy/2012/01/25/export-to-excel-got-easier/
Thanks but the file which I have to import to my SAS Studio is passenger.xls. Proc Import is working fine but when I'm trying to use Libname statement it is giving error.
So you are trying to import via libname statement, then please try the below
/* because Excel field names often have spaces */
options validvarname=any;
libname xl XLSX '/folders/myfolders/sample.xlsx';
/* read in one of the tables */
data sample;
set xl.sample;
run;
libname xl CLEAR;
Thanks
I tried but it is giving me error that xls engine not found
I'm using SAS Studio noy SAS 9.4 or 9.3
Are you using SAS Studio from University Edition? If not, what platform is your SAS server running on?
Some DBMS= values are only available on Windows.
Yes I'm using SAS Studio university Edition
@Swati24 wrote:
Yes I'm using SAS Studio university Edition
In that case, you need to convert your Excel workbook to the xlsx format, as the Engines for the older xls files are only available on Windows (University Edition runs on a Linux virtual machine).
Ok Thanks for the solution
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 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.
Ready to level-up your skills? Choose your own adventure.