BookmarkSubscribeRSS Feed
shawn123
Obsidian | Level 7

Hi guys, I find a question online, the question is shown below

question.PNG

So the answer is not based on SAS SQL, and the answer cannot work in proc SQL, is there any way to write in proc SQL?

4 REPLIES 4
SASKiwi
PROC Star

Here is one way that will work in SAS SQL:

where cats(C1, C2, C3) contains 'Yellow'
PGStats
Opal | Level 21

Another SAS/SQL way:

 

where whichc("Yellow", c1, c2, c3);

PG
Ksharp
Super User

Another SQL way:

 

where sum(c1='Yellow',c2='Yellow',c3='Yellow') ;

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 lock in 2025 pricing—just $495!

Register now

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
  • 4 replies
  • 1450 views
  • 6 likes
  • 4 in conversation