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
April 27 – 30 | Gaylord Texan | Grapevine, Texas
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!
Get started using SAS Studio to write, run and debug your SAS programs.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.