BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
Tecla1
Quartz | Level 8

data TITOLI_&DATA. ;
set DIPO.CHECK_&FILE._&DATA. ;
IF find(EVENTO_DESC_1,"argen","lehm","i") GE 1;
run;

ciao a tutti, non riesco a far cercare due parole ("argen" e "lehm"), con una sola ho il risultato. Ho provato in tutti i modi, avete un seggerimento? 

Tnks

1 ACCEPTED SOLUTION

Accepted Solutions
PeterClemmensen
Tourmaline | Level 20

It is easier to search for multiple string using PRX functions like this

 

data temp;
    set sashelp.cars;
    if prxmatch('/audi|acura|volvo/i', make) > 0;
run;

View solution in original post

8 REPLIES 8
PeterClemmensen
Tourmaline | Level 20

It is easier to search for multiple string using PRX functions like this

 

data temp;
    set sashelp.cars;
    if prxmatch('/audi|acura|volvo/i', make) > 0;
run;
Tecla1
Quartz | Level 8
Grazie !!!
PeterClemmensen
Tourmaline | Level 20
Tecla1
Quartz | Level 8
al posto delle variabili posso inserire il nome di una tabella che contiene le variabili?
PeterClemmensen
Tourmaline | Level 20

No. That's an entirely different problem 🙂

 

But describe your problem in detail please. I'll see what I can do

Tecla1
Quartz | Level 8

data test;
   input name $;
   datalines; 
argen
lehm;
run; 

	data TITOLI_&DATA.  ;
set DIPO.CHECK_&FILE._&DATA.;
    if prxmatch( test 'i', EVENTO_DESC_1) > 0;
run;

Vorrei inserire tutte le parole da ricercare in una tabella e chiedere a SAS di cercare quelle parole o simili nel DB

PeterClemmensen
Tourmaline | Level 20

A few questions:

 

  1. You say in the DB. Is this an actual data base or a SAS library?
  2. Should we search for the list of words in all columns in all tables in the DB?
  3. How similar is similar?

 

Tecla1
Quartz | Level 8
1) Le parole da cercare sono in 'test' e le devo cercare nel DB 'DIPO.CHECK_&FILE._&DATA.'
2) Le parole sono da cercare nella colonna 'EVENTO_DESC_1' che fa parte del DB 'DIPO.CHECK_&FILE._&DATA.'
3) Le parole uguali o simili a quelle contenute in 'test'
Grazie !!!!!

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!

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
  • 8 replies
  • 883 views
  • 1 like
  • 2 in conversation