BookmarkSubscribeRSS Feed
nguyek13
Calcite | Level 5

Trying to import data but got 4 errors and have no clue how to solve it? 

 

/** Import an XLSX file.  **/ 
 
PROC IMPORT DATAFILE="/folders/myfolders/Aspirin Use DATA.xls" 
		    OUT=Aspirin Use 
		    DBMS=XLSX 
		    REPLACE; 
RUN; 
 
/** Print the results. **/ 
 
PROC PRINT DATA=Aspirin Use;  
RUN;

 

4 REPLIES 4
Reeza
Super User
Please include the errors, and preferably the full log.
nguyek13
Calcite | Level 5
 Notes (4)
 
 1          OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
 72         
 73         /** Import an XLSX file.  **/
 74         
 NOTE: PROCEDURE IMPORT used (Total process time):
       real time           0.00 seconds
       cpu time            0.00 seconds
       
 NOTE: The SAS System stopped processing this step because of errors.
 75         PROC IMPORT DATAFILE="/folders/myfolders/Aspirin Use DATA.xls"
 76             OUT= Aspirin Use
                               ___
                               22
                               202
 ERROR 22-322: Syntax error, expecting one of the following: ;, (, DATAFILE, DATATABLE, DBMS, DEBUG, FILE, OUT, REPLACE, TABLE, 
               _DEBUG_.  
 
 ERROR 202-322: The option or parameter is not recognized and will be ignored.
 
 77             DBMS=XLSX
 78             REPLACE;
 79         RUN;
 80         
 81         /** Print the results. **/
 82         
 
 
 83         PROC PRINT DATA= Aspirin Use;
                                     ___
                                     22
                                     202
 ERROR 22-322: Syntax error, expecting one of the following: ;, (, BLANKLINE, CONTENTS, DATA, DOUBLE, GRANDTOTAL_LABEL, 
               GRANDTOT_LABEL, GRAND_LABEL, GTOTAL_LABEL, GTOT_LABEL, HEADING, LABEL, N, NOOBS, NOSUMLABEL, OBS, ROUND, ROWS, SPLIT, 
               STYLE, SUMLABEL, UNIFORM, WIDTH.  
 ERROR 202-322: The option or parameter is not recognized and will be ignored.
 84         RUN;
 
 NOTE: The SAS System stopped processing this step because of errors.
 NOTE: PROCEDURE PRINT used (Total process time):
       real time           0.00 seconds
       cpu time            0.00 seconds
       
 85         
 86         OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
 99         
novinosrin
Tourmaline | Level 20
what is the word "use" doing in proc import?
Astounding
PROC Star

Blanks are not legitimate characters for naming a data set.  If you would like, you can use an underscore:  Aspirin_Use

Catch up on SAS Innovate 2026

Dive into keynotes, announcements and breakthroughs on demand.

Explore Now →
Develop Code with SAS Studio

Get started using SAS Studio to write, run and debug your SAS programs.

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
  • 4 replies
  • 2939 views
  • 0 likes
  • 4 in conversation