[prev in list] [next in list] [prev in thread] [next in thread] 

List:       sas-l
Subject:    Re: Check multiple values in a table column
From:       Bartosz_Jabłoński <yabwon () GMAIL ! COM>
Date:       2020-10-25 21:27:08
Message-ID: CAMJ3xTN79UXUBfjvM4a2QpYCcLfx01NBo-fPf5RDkVOn=agG2A () mail ! gmail ! com
[Download RAW message or body]

As Richard suggested the Index() is an option but, next to Index(), there
is also Findw() function, which allows for modifiers.

data _null_;
  flag + (Findw('cef;abc;bcd','abc',';')>0) +
(Findw('cef;abc;bcd','def',';')>0);
  put _all_;
run;

All the best
Bart

pt., 23 pa=C5=BA 2020 o 21:12 subin alex <alexkutty19@gmail.com> napisa=C5=
=82(a):

> Hello experts,
>
> I am trying to solve a problem in sas,where in I need to check presence o=
f
> multiple values in a column which has values seperated by delimiter. I kn=
ow
> this can be done by looping with  scan function and also by prxmatch
> function.
>
> Since this check is done on a table which has 10 million plus  rows, am
> looking for an efficient method.
>
> Eg : to check if ('abc' , 'def') in (cef;abc;bcd)
>
>
> Please let me know if there is an efficient method other than the ones I
> mentioned to solve this problem.
>
>
>
> Thanks,
> Subin Alex
>

[Attachment #3 (text/html)]

<div dir="ltr"><div class="gmail_default" \
style="font-family:monospace,monospace"><div class="gmail_default">As Richard \
suggested the Index() is an option but, next to Index(), there is also Findw() \
function, which allows  for modifiers.</div><div class="gmail_default"><br></div><div \
class="gmail_default">data _null_;<br>   flag + \
(Findw(&#39;cef;abc;bcd&#39;,&#39;abc&#39;,&#39;;&#39;)&gt;0) + \
(Findw(&#39;cef;abc;bcd&#39;,&#39;def&#39;,&#39;;&#39;)&gt;0);<br>   put \
_all_;<br>run;<br></div><div class="gmail_default"><br></div><div \
class="gmail_default">All the best</div><div \
class="gmail_default">Bart</div></div></div><br><div class="gmail_quote"><div \
dir="ltr" class="gmail_attr">pt., 23 paź 2020 o 21:12  subin alex &lt;<a \
href="mailto:alexkutty19@gmail.com">alexkutty19@gmail.com</a>&gt; \
napisał(a):<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px \
0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto">Hello \
experts,<div dir="auto"><br></div><div dir="auto">I am trying to solve a problem in \
sas,where in I need to check presence of multiple values in a column which has values \
seperated by delimiter. I know this can be done by looping with   scan function and \
also by prxmatch function.</div><div dir="auto"><br></div><div dir="auto">Since this \
check is done on a table which has 10 million plus   rows, am looking for an \
efficient method.</div><div dir="auto"><br></div><div dir="auto">Eg : to check if \
(&#39;abc&#39; , &#39;def&#39;) in (cef;abc;bcd)</div><div dir="auto"><br></div><div \
dir="auto"><br></div><div dir="auto">Please let me know if there is an efficient \
method other than the ones I mentioned to solve this problem.</div><div \
dir="auto"><br></div><div dir="auto"><br></div><div dir="auto"><br></div><div \
dir="auto">Thanks,</div><div dir="auto">Subin Alex</div></div> </blockquote></div>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic