BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
ivarenho
Fluorite | Level 6

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.

1 ACCEPTED SOLUTION

Accepted Solutions
FreelanceReinh
Jade | Level 19

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:

ODS EXCEL <(<ID=> identifier)> < action> ;
ODS EXCEL <(<ID=> identifier)> <options> ;

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.

View solution in original post

2 REPLIES 2
FreelanceReinh
Jade | Level 19

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:

ODS EXCEL <(<ID=> identifier)> < action> ;
ODS EXCEL <(<ID=> identifier)> <options> ;

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.

ivarenho
Fluorite | Level 6

Thank you!

Catch up on SAS Innovate 2026

Nearly 200 sessions are now available on demand with the SAS Innovate Digital Pass.

Explore Now →
How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 134 views
  • 0 likes
  • 2 in conversation