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;
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
Blanks are not legitimate characters for naming a data set. If you would like, you can use an underscore: Aspirin_Use
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.