Maybe it is due to the typo?
I see a .xlxs extension, which should be a .xlsx extension...
I use this for code for xls and xlsx files
&prjdir is a macro for the file path.
&file1 and &sheet1 are macros for the file name and sheet name you want to read
filename case DDE "Excel|&prjdir.[&file1.]&sheet2.!R<first row>C<first column>:R<last row>C<last column>" notab;
data want;
infile case dsd dlm='09'x missover pad lrecl=1500;
length <vars with lengths>;
input <vars>;
run;
filename case clear;
So a filled in example.
%LET prjdir=C:\Desktop\WR213548\;
%LET file1=test;
%LET sheet1=sheet1;
filename case DDE "Excel|&prjdir.[&file1.]&sheet2.!R1C1:R1000C25" notab; *1000 rows 25 columns;
data want;
infile case dsd dlm='09'x missover pad lrecl=1500; *change lrecl to fit your full row length;
length var1-var25 $20.;
input var1-var25;
run;
filename case clear;
Edit as needed. Make sure that you have your excel file open and enabled editing before running this or you'll get an error.
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.