BookmarkSubscribeRSS Feed
ccherrub
Obsidian | Level 7

New to SAS and I'm not sure why I'm getting this error:

PROC SQL;
CREATE TABLE WORK.query AS
SELECT 'year'n , id , statefips , male , raceethnic , ed , marst , nchild , occ , ind , wkswork , age , income FROM _TEMP0.db1;
RUN;
QUIT;

PROC DATASETS NOLIST NODETAILS;
CONTENTS DATA=WORK.query OUT=WORK.details;
RUN;

PROC PRINT DATA=WORK.details;
RUN;

PROC MEANS DATA=work.query NONOBS MAXDEC=2 SUM MEAN STD ;
VAR male , raceethnic , ed , marst , nchild , occ , ind , wkswork , age , income ;
RUN;

________

70 PROC MEANS DATA=work.query NONOBS MAXDEC=2 SUM MEAN STD ;
71 VAR #1;
_
22
200
ERROR 22-322: Syntax error, expecting one of the following: a name, ;, /, _ALL_, _CHARACTER_, _CHAR_, _NUMERIC_.
ERROR 200-322: The symbol is not recognized and will be ignored.
72 RUN;
 
1 REPLY 1
Reeza
Super User
There should be no comma's in the list of variables provided to PROC MEANS.

var male raceethnic ed ....

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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