hi would like to search in a character variable in a large dataset. This variable "seriesdescription" contains free entry of text data (see screenshot). I have a set of 50 different strings in lower case that are buried in this variable at various positions.
I was using this code
vista=0;
if index(lowcase(seriesdescription),'3pl loc')>0 then vista=1;
if index(lowcase(seriesdescription),'cine')>0 then vista=1;
if index(lowcase(seriesdescription),'lge')>0 then vista=1;
I tried scan function but could not make it work.
but that is very cumbersome. Do you have a better solution ? thanks
@rykwong Please post the same question only once.
This is a duplicate of https://communities.sas.com/t5/SAS-Programming/need-help-using-index-function-to-seach-for-multiple-... where you've got already some answers.
@rykwong Please post the same question only once.
This is a duplicate of https://communities.sas.com/t5/SAS-Programming/need-help-using-index-function-to-seach-for-multiple-... where you've got already some answers.
my apology. I thought the first one did not get through. many thanks for the answers
Also providing example data in screenshots is useless as we can't copy and paste it into code examples. Please provide the data in a usable form like a simple copy and paste.
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.
Ready to level-up your skills? Choose your own adventure.