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

Hi,

I can't get this simple Where statement to work

 

data output.PCE_meds;
set output.RXClaims;
Where SYSCORTFlag ='Y' or BRONCHOFlag 'Y';
run;

 

This is the error that I get when running to the above code:

SYMBOLGEN: Macro variable _EGNOTES resolves to NOTES
SYMBOLGEN: Macro variable _EGSOURCE resolves to SOURCE
31
32 data output.PCE_meds;
33 set output.RXClaims;
34 Where SYSCORTFlag ='Y' or BRONCHOFlag 'Y';
___
22
76
ERROR: Syntax error while parsing WHERE clause.
ERROR 22-322: Syntax error, expecting one of the following: !, !!, &, *, **, +, -, /, <, <=, <>, =, >, >=, ?, AND, CONTAINS, EQ,
GE, GT, LE, LIKE, LT, NE, OR, ^=, |, ||, ~=.

ERROR 76-322: Syntax error, statement will be ignored.

1 ACCEPTED SOLUTION

Accepted Solutions
WarrenKuhfeld
Ammonite | Level 13

Where SYSCORTFlag ='Y' or BRONCHOFlag = 'Y';

 

Add an equal sign in front of the second 'Y'.

View solution in original post

2 REPLIES 2
WarrenKuhfeld
Ammonite | Level 13

Where SYSCORTFlag ='Y' or BRONCHOFlag = 'Y';

 

Add an equal sign in front of the second 'Y'.

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and save with the early bird rate—just $795!

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
  • 2 replies
  • 785 views
  • 1 like
  • 2 in conversation