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

I choose any table - I can change it any time. The table has numeric and character variables. I would like to have possibility to search and find any text in character columns, for example by prompt manager, and show all rows for typed text.

 

Could you give me some tips how I should start? I thought about prompts one for type the text, and the second one to choose character variables (but they can change if I change the table).

 

Thank you in advance.

 

 

 

1 ACCEPTED SOLUTION
2 REPLIES 2
Reeza
Super User

Here is a reference that illustrates how to refer to variables and datasets in a short cut list:
https://blogs.sas.com/content/iml/2018/05/29/6-easy-ways-to-specify-a-list-of-variables-in-sas.html

 

You can refer to the _character_ for all variables. 

 

Using something like the following should get you started. X will concatenate all character variables into a single string that you cna then search with FIND/INDEX. Not sure what you want to do after that.

 

x = catx("|", of _character_);
y = find("ValueToFind", x);

@MargoBlue wrote:

I choose any table - I can change it any time. The table has numeric and character variables. I would like to have possibility to search and find any text in character columns, for example by prompt manager, and show all rows for typed text.

 

Could you give me some tips how I should start? I thought about prompts one for type the text, and the second one to choose character variables (but they can change if I change the table).

 

Thank you in advance.

 

 

 


 

sas-innovate-wordmark-2025-midnight.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


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
  • 2 replies
  • 777 views
  • 2 likes
  • 3 in conversation