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-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

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
  • 2244 views
  • 0 likes
  • 2 in conversation