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

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

Register now!

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