BookmarkSubscribeRSS Feed
UV_123
Calcite | Level 5

Hi All,

 

I want a small help where in I want to search a column for 2 words and if both words are present then execute an if statement else execute the other part. 

 

For example, if I have 2 strings in a column: Input1:Hello.everyone.how.are.you

                                                                       Input2:Hello.all.how.are.you

then if "Input1" and "Every" is present in a single row of a column, the output should be 1. So for the first string output should be 1 and for the second one output should be 0. 

 

Thank you in advance. 

1 REPLY 1
Kurt_Bremser
Super User

The word "Every" is not present anywhere in your data. Please review your question:

  • words or substrings?
  • case sensitivity?
  • if words, which are the delimiters?

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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