BookmarkSubscribeRSS Feed
Aiman
Fluorite | Level 6

Hi, I tried to import and read my xlsx data to sas studio, im running into this error "XLSX not valid for import" and "FILE.WORK.IMPORT.DATA doest not exist", this is the code that I run , it is from sas snippet library. 

 

/* Generated Code (IMPORT) */
/* Source File: raw input data.xlsx */
/* Source Path: /Users/maiman.khalid/My Folder/raw input data.xlsx */
/* Code generated on: May 4, 2020, 4:05:09 PM */

proc sql;
%if %sysfunc(exist(WORK.IMPORT)) %then %do;
    drop table WORK.IMPORT;
%end;
%if %sysfunc(exist(WORK.IMPORT,VIEW)) %then %do;
    drop view WORK.IMPORT;
%end;
quit;



FILENAME REFFILE FILESRVC FOLDERPATH='/Users/maiman.khalid/My Folder'  FILENAME='raw input data.xlsx';

PROC IMPORT DATAFILE=REFFILE
	DBMS=XLSX
	OUT=WORK.IMPORT;
	GETNAMES=YES;
RUN;

PROC CONTENTS DATA=WORK.IMPORT; RUN;

proc print data=work.import(obs=3);
run;

 

2 REPLIES 2
andreas_lds
Jade | Level 19

Please post the full log as text.

AhmedAl_Attar
Ammonite | Level 13

Try using the xlsx libname engine instead

/* because Excel field names often have spaces */
options validvarname=any;
 
libname xl XLSX "/folders/myfolders/raw input data.xlsx";   *<--- Change the path;
 
/* discover member (DATA) names */
proc datasets lib=xl; quit;

/* read in one of the tables */
data work.import;
  set xl.<Sheet Name>;  *<--- Change the SHEET Name;
run;
libname xl CLEAR;

Hope this helps,

Ahmed

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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
  • 2 replies
  • 2160 views
  • 0 likes
  • 3 in conversation