BookmarkSubscribeRSS Feed
rishabhmehra13
Calcite | Level 5

/** Import an XLSX file.  **/
libname g '/folders/myfolders/';
PROC IMPORT DATAFILE="/folders/myfolders/grocery_coupons.xls";
      OUT=g.permanent
      DBMS=XLSX
      REPLACE;
RUN;

/** Print the results. **/

PROC PRINT DATA=g.permanent; RUN;

 

 

log

 

Engine: V9
Physical Name: /folders/myfolders
58 PROC IMPORT DATAFILE="/folders/myfolders/grocery_coupons.xls";
ERROR: Output SAS data set must be provided.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE IMPORT used (Total process time):
real time 0.00 seconds
cpu time 0.01 seconds
 
59 OUT=g.permanent
60 DBMS=XLSX
61 REPLACE;
62 RUN;
63
64 /** Print the results. **/
65
 
 
66 PROC PRINT DATA=g.permanent; RUN;
3 REPLIES 3
Reeza
Super User

The error is the same as in your last question. 

 

https://communities.sas.com/t5/SAS-Analytics-U/Error-using-Proc-import/m-p/290978

 

There is no semicolon after the file path. 

Cynthia_sas
SAS Super FREQ
Hi, in addition, please check the documentation for DBMS=XLSX -- you show that your file name is .XLS, not .XLSX, so you may be trying the wrong engine to read the file, once you get your syntax worked out.

cynthia
Tom
Super User Tom
Super User

I always place the semi-colon on a multiple line statement on a new line and align it with the beginning of the statement. The lines in between are indented. The same way that I format DO/END blocks of code.  

 

I find that is makes it much less likely that I will accidently insert an extra semi-colon into the middle of long statements.

 

libname g '/folders/myfolders/';
PROC IMPORT
  DATAFILE='/folders/myfolders/grocery_coupons.xlsx'
  OUT=g.permanent
  DBMS=XLSX
  REPLACE
;
RUN;

 

sas-innovate-2024.png

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.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 1864 views
  • 0 likes
  • 4 in conversation