BookmarkSubscribeRSS Feed
Pat_5
Calcite | Level 5

Hello!

I'm having trouble importing an external file in excel format to SAS DI Studio.
Inside SAS, I'm creating an external file > User input...

We don't have direct access to files in SAS.


In the metadata section I put the following code:


PROC IMPORT OUT=WORK.file;

 DATAFILE="/mydata/Sample Data.xlsx"
 DBMS=xls REPLACE;
SHEET="Sheet1$";
GETNAMES=YES;
MIXED=YES;
SCANTEXT=YES;
USEDATE=YES;
SCANTIME=YES;
RUN;

 

The file is created, but it does not load any data and with the File Reader transformation and I get the following error:


ERROR: FILE = OR TABLE= IS REQUIERED AND MUST BE SPECIFIED

 

sas.PNG

Excel only has one sheet with different types of data. I don't know if I have to define the SAS code in the external file differently, but I have defined the columns well or you can't load external files in excel format this way.

 

Could someone tell me a possible solution, please?

 

Thank you very much.

 

3 REPLIES 3
LinusH
Tourmaline | Level 20

You mean User Written external file, right?

 

What do you mean you don't have direct access to files?

 

Is your PROC IMPORT working outside DI Studio?

Data never sleeps
Pat_5
Calcite | Level 5
Yes, I mean User Written an external file

I don't have direct access to the folder where the files are uploaded. I don't know if that's a problem.

How can I compare that my PROC IMPORT works outside SAS DI?
LinusH
Tourmaline | Level 20

Try the code in Enterprise Guide, SAS Studio or even in the DI Studio code editor.

 

Once working there, try to implement in the metadata. 

Data never sleeps

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!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 3 replies
  • 2545 views
  • 0 likes
  • 2 in conversation