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.

 

 

 


 

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 564 views
  • 2 likes
  • 3 in conversation