BookmarkSubscribeRSS Feed
4301
Calcite | Level 5

RROR 22-322: Syntax error, expecting one of the following: ;, (, COMPRESS, DATA, FC,
FORMCHAR, NLEVELS, NOPRINT, ORDER, PAGE.
ERROR 202-322: The option or parameter is not recognized and will be ignored

 

 

*unadjusted association;
proc freq data=gene env;
table hstatus*cannabis/nopercent nocol cmh;
run;

1 REPLY 1
ballardw
Super User

When referencing an error please copy from the log the entire procedure along with all the messages for the step that throws the error. Then paste into a code box on the forum opened using the {I} icon. The code box will preserve formatting of the error messages and many will generate an underscore or two showing where the syntax issue was encountered.

 

For instance in your case I suspect you have a more complete log entry similar to :

39   proc freq data=gene env;
                         ---
                         22
                         202
ERROR: File USER.GENE.DATA does not exist.
ERROR 22-322: Syntax error, expecting one of the following: ;, (, COMPRESS, DATA, FC, FORMCHAR,
              NLEVELS, NOPRINT, ORDER, PAGE.
ERROR 202-322: The option or parameter is not recognized and will be ignored.

This indicates that you have a space in the middle of your data set name, whether it was supposed to GENEENV or GENE_ENV or similar. Fix the data set name. ENV by itself is not an option of Proc Freq hence the wording of :

ERROR 22-322: Syntax error, expecting one of the following: ;, (, COMPRESS, DATA, FC, FORMCHAR, NLEVELS, NOPRINT, ORDER, PAGE. 

Please notice that there are 3 underscore characters under the word ENV in the error message. Which is pretty clear about indicating that is not a valid option.

 

The Entire procedure or data step is needed because sometimes the error cause actually can come from something missing in lines above the reported location. 

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 1 reply
  • 458 views
  • 0 likes
  • 2 in conversation