Write and run SAS programs in your web browser

ERROR 22-322: Syntax error. Proc Univariate

Reply
Occasional Contributor
Posts: 6

ERROR 22-322: Syntax error. Proc Univariate

I have obtained an error message when running the Proc Univariate for my datasets.
Can anyone assist me in overcoming this error?
The error result is shown below and see attachment::
 
Proc univariate data=asmt_raw_cervical_cancer;
61 var Age , Number_of_sexual_partners , 'First_sexual_intercourse_(age)'n , Number_of_pregnancies , 'Smokes_(years)'n ,
_
______
______
22
49
49
76
61 ! 'Smokes_(packs/year)'n, 'IUD_(years)'n, 'STDs_(how_many?)'n, Number_of_diagnosis'n , 'STDs_Year_since_first_diagnosis'n ,
61 ! 'STDs_Year_since_last_diagnosis'n;
ERROR 22-322: Syntax error, expecting one of the following: a name, ;, -, :, _ALL_, _CHARACTER_, _CHAR_, _NUMERIC_.
NOTE 49-169: The meaning of an identifier after a quoted string might change in a future SAS release. Inserting white space
between a quoted string and the succeeding identifier is recommended.
ERROR 76-322: Syntax error, statement will be ignored.

error_running_proc_univariate.PNG
Super User
Posts: 6,938

Re: ERROR 22-322: Syntax error. Proc Univariate

[ Edited ]

In Base SAS, variables in var lists are separated only by blanks, not by commas.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Super User
Posts: 10,500

Re: ERROR 22-322: Syntax error. Proc Univariate

For future reference, paste code from the log with error messages into a code box using the forum {i} icon. That will preserve the plain text format of the log and the underscore characters, which show where SAS detected the error will align correctly. The main message windows on this forum will reformat pasted text otherwise.

Ask a Question
Discussion stats
  • 2 replies
  • 189 views
  • 2 likes
  • 3 in conversation