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

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 707 views
  • 0 likes
  • 2 in conversation