You could use something like:
data strings;
input string $upcase.;
cards;
ro
an
;
proc sql;
select "upcase(NAME) contains '"||trim(string)||"'"
into :strings
separated by " or "
from strings
;
select NAME
from SASHELP.CLASS (where=(&strings.))
;
quit;
HTH,
Art
-----
> Hello,
>
> can I ask a related question ---> I am also trying to
> search strings with proc sql (extracting data from
> DB2 using PROC SQL) by using WHERE condition (and
> need to avoid using data step) to reduce the number
> of observations extracted.
>
> My question is --->
> Is there a way to modify "in:" from the below to able
> to search any substring?
>
> proc sql;
> select NAME from SASHELP.CLASS(where=(NAME
> in:('A','B')));
> quit;
>
> For example,
> I want to find all names that have "ane" in the
> string, But "in:" only captures strings that start
> with "ane".
>
> Could you kindly advise? Thank you very much.