Below are the errors I'm trying to resolve from an activity in the Program 1 Essentials course.
ods excel=file "&let/pressure.xlsx" style=analysis;
_
22
76
I've worked to correct the macro from a previous activity and to correct the syntax in this activity as well.
ERROR 22-322: Syntax error, expecting one of the following: ;, (, ANCHOR, AUTHOR, BOX_SIZING, CATEGORY, CLOSE, COMMENTS,
CSSSTYLE, DOM, DPI, EXCLUDE, FILE, GFOOTNOTE, GTITLE, IMAGE_DPI, KEYWORDS, NOGFOOTNOTE, NOGTITLE, OPTIONS, SASDATE,
SELECT, SHOW, STATUS, STYLE, SUBJECT, TEXT, TITLE, WORK.
ERROR 76-322: Syntax error, statement will be ignored.
Hello @ivarenho,
Whenever you wonder why a syntax error has occurred, compare the syntax of your code to the corresponding syntax pattern shown in the SAS documentation.
In your example, the syntax pattern in the documentation of the ODS EXCEL statement, actually two alternative patterns, look like this:
Among the "options" listed in the "Summary of Optional Arguments" you find the FILE= and STYLE= options that you are about to use, but note the correct position of the equals sign in the FILE= option.
After correcting that I would double-check the name of the macro variable you are referring to in the path of the .xlsx file. To avoid confusion with the %LET statement, it would be better not to name it LET.
Hello @ivarenho,
Whenever you wonder why a syntax error has occurred, compare the syntax of your code to the corresponding syntax pattern shown in the SAS documentation.
In your example, the syntax pattern in the documentation of the ODS EXCEL statement, actually two alternative patterns, look like this:
Among the "options" listed in the "Summary of Optional Arguments" you find the FILE= and STYLE= options that you are about to use, but note the correct position of the equals sign in the FILE= option.
After correcting that I would double-check the name of the macro variable you are referring to in the path of the .xlsx file. To avoid confusion with the %LET statement, it would be better not to name it LET.
Thank you!
Nearly 200 sessions are now available on demand with the SAS Innovate Digital Pass.
Explore Now →Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.