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