BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Kimberly_2020
Calcite | Level 5

Hello there,

 

I am trying to create a frequency table for gender and sexual orientation between the ages of 18-50. Where am I going wrong. 

Code:
proc freq data=WORK.SYPHILIS;
	tables genderC genderB sex_o age RACE / plots=(freqplot cumfreqplot);
	where  Type in ("genderC", "genderB", "sex_o", age "18-50");
run;

Log:

87         proc freq data=WORK.SYPHILIS;
 88         tables genderC genderB sex_o age RACE / plots=(freqplot cumfreqplot);
 89         where  Type in ("genderC", "genderB", "sex_o", age "18-50");
                                                            ___
                                                            22
                                                            202
 ERROR: Syntax error while parsing WHERE clause.
 ERROR 22-322: Syntax error, expecting one of the following: a quoted string, ).  
 ERROR 202-322: The option or parameter is not recognized and will be ignored.
 90         run;
 
1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26

I think this will work

 

where  Type in ("genderC", "genderB", "sex_o") and 18<=age<=50

This assumes age is numeric

--
Paige Miller

View solution in original post

1 REPLY 1
PaigeMiller
Diamond | Level 26

I think this will work

 

where  Type in ("genderC", "genderB", "sex_o") and 18<=age<=50

This assumes age is numeric

--
Paige Miller

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 1020 views
  • 0 likes
  • 2 in conversation