<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic findw does not work on fixed string using sysfunc, but does in datastep in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/findw-does-not-work-on-fixed-string-using-sysfunc-but-does-in/m-p/832260#M328940</link>
    <description>&lt;P&gt;I need to get the index of a macro value in another macro string.&amp;nbsp; findw seemed like it would work for this but it does not work with sysfunc.&amp;nbsp; I made an example below.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;the code below sets varfind = 0 and varfinddata =3;&amp;nbsp; the warning message is:&lt;/P&gt;
&lt;PRE id="pre_sasLog_315" class="sasLog" style="background-color: transparent; -webkit-user-select: text; -webkit-user-modify: read-only; -webkit-touch-callout: default; border-top-width: 0px; border-bottom-width: 0px;"&gt;WARNING: In a call to the FINDW function or routine, the modifier "'" not valid.&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;quoting the space such as&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;varfind = %sysfunc(findw("&amp;amp;testin","&amp;amp;count",%str(" "), %nrstr(%str('E')) ));&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp; does not seem to help.&amp;nbsp; what is failing when trying to use sysfunc?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;%let testin =v vsd count f;
%let count =count;


%macro test();
    var="&amp;amp;testin";
    varfind = %sysfunc(findw(&amp;amp;testin,"&amp;amp;count",' ', 'E'));
    
    varfinddata=findw("&amp;amp;testin","&amp;amp;count", ' ', 'E');

%mend test;


data a;
%test
run;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 07 Sep 2022 21:54:30 GMT</pubDate>
    <dc:creator>weg</dc:creator>
    <dc:date>2022-09-07T21:54:30Z</dc:date>
    <item>
      <title>findw does not work on fixed string using sysfunc, but does in datastep</title>
      <link>https://communities.sas.com/t5/SAS-Programming/findw-does-not-work-on-fixed-string-using-sysfunc-but-does-in/m-p/832260#M328940</link>
      <description>&lt;P&gt;I need to get the index of a macro value in another macro string.&amp;nbsp; findw seemed like it would work for this but it does not work with sysfunc.&amp;nbsp; I made an example below.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;the code below sets varfind = 0 and varfinddata =3;&amp;nbsp; the warning message is:&lt;/P&gt;
&lt;PRE id="pre_sasLog_315" class="sasLog" style="background-color: transparent; -webkit-user-select: text; -webkit-user-modify: read-only; -webkit-touch-callout: default; border-top-width: 0px; border-bottom-width: 0px;"&gt;WARNING: In a call to the FINDW function or routine, the modifier "'" not valid.&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;quoting the space such as&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;varfind = %sysfunc(findw("&amp;amp;testin","&amp;amp;count",%str(" "), %nrstr(%str('E')) ));&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp; does not seem to help.&amp;nbsp; what is failing when trying to use sysfunc?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;%let testin =v vsd count f;
%let count =count;


%macro test();
    var="&amp;amp;testin";
    varfind = %sysfunc(findw(&amp;amp;testin,"&amp;amp;count",' ', 'E'));
    
    varfinddata=findw("&amp;amp;testin","&amp;amp;count", ' ', 'E');

%mend test;


data a;
%test
run;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Sep 2022 21:54:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/findw-does-not-work-on-fixed-string-using-sysfunc-but-does-in/m-p/832260#M328940</guid>
      <dc:creator>weg</dc:creator>
      <dc:date>2022-09-07T21:54:30Z</dc:date>
    </item>
    <item>
      <title>Re: findw does not work on fixed string using sysfunc, but does in datastep</title>
      <link>https://communities.sas.com/t5/SAS-Programming/findw-does-not-work-on-fixed-string-using-sysfunc-but-does-in/m-p/832263#M328941</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let testin = v vsd count f;
%let count =count;
%let varfind = 0;

%let varfind = %sysfunc(findw(&amp;amp;testin, &amp;amp;count, %str(' ')  , e));
%put &amp;amp;varfind;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This works for me.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/309205"&gt;@weg&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I need to get the index of a macro value in another macro string.&amp;nbsp; findw seemed like it would work for this but it does not work with sysfunc.&amp;nbsp; I made an example below.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;the code below sets varfind = 0 and varfinddata =3;&amp;nbsp; the warning message is:&lt;/P&gt;
&lt;PRE id="pre_sasLog_315" class="sasLog" style="background-color: transparent; -webkit-user-select: text; -webkit-user-modify: read-only; -webkit-touch-callout: default; border-top-width: 0px; border-bottom-width: 0px;"&gt;WARNING: In a call to the FINDW function or routine, the modifier "'" not valid.&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;quoting the space such as&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;varfind = %sysfunc(findw("&amp;amp;testin","&amp;amp;count",%str(" "), %nrstr(%str('E')) ));&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp; does not seem to help.&amp;nbsp; what is failing when trying to use sysfunc?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;%let testin =v vsd count f;
%let count =count;


%macro test();
    var="&amp;amp;testin";
    varfind = %sysfunc(findw(&amp;amp;testin,"&amp;amp;count",' ', 'E'));
    
    varfinddata=findw("&amp;amp;testin","&amp;amp;count", ' ', 'E');

%mend test;


data a;
%test
run;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Sep 2022 22:14:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/findw-does-not-work-on-fixed-string-using-sysfunc-but-does-in/m-p/832263#M328941</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2022-09-07T22:14:48Z</dc:date>
    </item>
  </channel>
</rss>

