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

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register 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
  • 2636 views
  • 0 likes
  • 4 in conversation