<?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 Re: Has anyone had success with the T modifier in FINDW() function? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Has-anyone-had-success-with-the-T-modifier-in-FINDW-function/m-p/986788#M379989</link>
    <description>&lt;P&gt;I was usually happy to use STRIP() instead of T modification.&lt;/P&gt;
&lt;PRE&gt;7    data _null_;
8      length element $8;
9      element = 'BE';
10     found_at = findw('H He Li Be B C N O F Ne',&lt;STRONG&gt;strip(element)&lt;/STRONG&gt;,' ','i');
11     put found_at= ;
12     run;

found_at=9
&lt;/PRE&gt;</description>
    <pubDate>Sat, 25 Apr 2026 06:46:08 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2026-04-25T06:46:08Z</dc:date>
    <item>
      <title>Has anyone had success with the T modifier in FINDW() function?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Has-anyone-had-success-with-the-T-modifier-in-FINDW-function/m-p/986784#M379986</link>
      <description>&lt;P&gt;In this example I expect FINDW to trim the BE value in element and find a match. It does not.&lt;/P&gt;
&lt;P&gt;The only case FINDW works for me is when there is an explicit trim of the word and the T modifier is left out.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lefunctionsref/p16rdsa30vmm43n1ej4936nwa01t.htm" target="_blank" rel="noopener"&gt;SAS Help Center: FINDW Function&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
  length element $8;&lt;BR /&gt;
  element = 'BE';
  found_at = findw('H He Li Be B C N O F Ne',element,' ','it');
  put found_at= ;

  found_at = findw('H He Li Be B C N O F Ne',element,' ',1,'it');
  put found_at= ;

  delims = ' ' ;
  found_at = findw('H He Li Be B C N O F Ne',element,delims,'it');
  put found_at= ;

  delims = ' ' ;
  found_at = findw('H He Li Be B C N O F Ne',element,1,delims,'it');
  put found_at= ;

  found_at = findw('H He Li Be B C N O F Ne',trim(element),' ','it');
  put found_at= 'explicit trim I and T modifiers' ;

  found_at = findw('H He Li Be B C N O F Ne',trim(element),' ','i');
  put found_at= 'explicit trim only I modifier';

  found_at = findw('Be H He Li B C N O F Ne',trim(element),' ','it');
  put found_at= 'explicit trim I and T modifiers, Be first position' ;
run;

found_at=0
found_at=0
found_at=0
found_at=0
found_at=0 explicit trim I and T modifiers
found_at=9 explicit trim only I modifier
found_at=0 explicit trim I and T modifiers, Be first position&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Apr 2026 19:13:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Has-anyone-had-success-with-the-T-modifier-in-FINDW-function/m-p/986784#M379986</guid>
      <dc:creator>RichardAD</dc:creator>
      <dc:date>2026-04-24T19:13:22Z</dc:date>
    </item>
    <item>
      <title>Re: Has anyone had success with the T modifier in FINDW() function?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Has-anyone-had-success-with-the-T-modifier-in-FINDW-function/m-p/986785#M379987</link>
      <description>&lt;P&gt;The T modifier removes the spaces.&amp;nbsp; Add the space back into the delimiter list by using the S modifier.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV id="n0cs4nyh8z1ft2n10ydg89fpcg4p" class="xisDoc-argDescriptionPair"&gt;
&lt;BLOCKQUOTE&gt;
&lt;H4 class="xisDoc-argument"&gt;s or S&lt;/H4&gt;
&lt;DIV class="xisDoc-argumentDescription"&gt;
&lt;P class="xisDoc-paraSimpleFirst"&gt;adds space characters (blank, horizontal tab, vertical tab, carriage return, line feed, and form feed) to the list of characters.&lt;/P&gt;
&lt;/DIV&gt;
&lt;/BLOCKQUOTE&gt;
&lt;/DIV&gt;
&lt;DIV id="p1okgzit5okmjqn1jzi4jshq3gee" class="xisDoc-argDescriptionPair"&gt;
&lt;BLOCKQUOTE&gt;
&lt;H4 class="xisDoc-argument"&gt;t or T&lt;/H4&gt;
&lt;H4 class="xisDoc-argument"&gt;&lt;SPAN&gt;trims trailing blanks from the&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM class="xisDoc-userSuppliedValue" style="font-family: inherit; font-size: 16px;"&gt;string&lt;/EM&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM class="xisDoc-userSuppliedValue" style="font-family: inherit; font-size: 16px;"&gt;word&lt;/EM&gt;&lt;SPAN&gt;, and&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM class="xisDoc-userSuppliedValue" style="font-family: inherit; font-size: 16px;"&gt;character&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;arguments.&lt;/SPAN&gt;&lt;/H4&gt;
&lt;/BLOCKQUOTE&gt;
&lt;/DIV&gt;
&lt;DIV id="p1b5wrdkox6kfwn1r4vg1uvektnm" class="xisDoc-argDescriptionPair"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
  length element $8;
  element = 'BE';
  found_at = findw('H He Li Be B C N O F Ne',element,' ','sit');
  put found_at= ;

  found_at = findw('H He Li Be B C N O F Ne',element,' ',1,'sit');
  put found_at= ;

  delims = ' ' ;
  found_at = findw('H He Li Be B C N O F Ne',element,delims,'sit');
  put found_at= ;

  delims = ' ' ;
  found_at = findw('H He Li Be B C N O F Ne',element,1,delims,'sit');
  put found_at= ;

  found_at = findw('H He Li Be B C N O F Ne',trim(element),' ','sit');
  put found_at= 'explicit trim I and T modifiers' ;

  found_at = findw('H He Li Be B C N O F Ne',trim(element),' ','si');
  put found_at= 'explicit trim only I modifier';

  found_at = findw('Be H He Li B C N O F Ne',trim(element),' ','sit');
  put found_at= 'explicit trim I and T modifiers, Be first position' ;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Result&lt;/P&gt;
&lt;PRE&gt; found_at=9
 found_at=9
 found_at=9
 found_at=9
 found_at=9 explicit trim I and T modifiers
 found_at=9 explicit trim only I modifier
 found_at=1 explicit trim I and T modifiers, Be first position&lt;/PRE&gt;</description>
      <pubDate>Fri, 24 Apr 2026 19:22:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Has-anyone-had-success-with-the-T-modifier-in-FINDW-function/m-p/986785#M379987</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2026-04-24T19:22:55Z</dc:date>
    </item>
    <item>
      <title>Re: Has anyone had success with the T modifier in FINDW() function?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Has-anyone-had-success-with-the-T-modifier-in-FINDW-function/m-p/986786#M379988</link>
      <description>&lt;H4 class="xisDoc-argument"&gt;t or T&amp;nbsp; &amp;nbsp;-&amp;nbsp;&lt;SPAN&gt;trims trailing blanks from the&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM class="xisDoc-userSuppliedValue" style="font-family: inherit; font-size: 16px;"&gt;string&lt;/EM&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM class="xisDoc-userSuppliedValue" style="font-family: inherit; font-size: 16px;"&gt;word&lt;/EM&gt;&lt;SPAN&gt;, and&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM class="xisDoc-userSuppliedValue" style="font-family: inherit; font-size: 16px;"&gt;character&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;arguments.&lt;/SPAN&gt;&lt;/H4&gt;
&lt;H4 class="xisDoc-argument"&gt;r or R&amp;nbsp; &amp;nbsp;-&amp;nbsp;&lt;SPAN&gt;removes leading and trailing delimiters from the&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM class="xisDoc-userSuppliedValue" style="font-family: inherit; font-size: 16px;"&gt;word&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;argument.&lt;/SPAN&gt;&lt;/H4&gt;
&lt;P&gt;It comes to light that that &lt;STRONG&gt;T&lt;/STRONG&gt; modifier is &lt;STRONG&gt;not to be used when the only delimiter character is a space.&amp;nbsp;&lt;/STRONG&gt;T will trim the space to nothing, and the function will happily fart in your general direction with no delimiters.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;R is the proper modifier for the case of a space delimiter.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Apr 2026 19:24:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Has-anyone-had-success-with-the-T-modifier-in-FINDW-function/m-p/986786#M379988</guid>
      <dc:creator>RichardAD</dc:creator>
      <dc:date>2026-04-24T19:24:09Z</dc:date>
    </item>
    <item>
      <title>Re: Has anyone had success with the T modifier in FINDW() function?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Has-anyone-had-success-with-the-T-modifier-in-FINDW-function/m-p/986788#M379989</link>
      <description>&lt;P&gt;I was usually happy to use STRIP() instead of T modification.&lt;/P&gt;
&lt;PRE&gt;7    data _null_;
8      length element $8;
9      element = 'BE';
10     found_at = findw('H He Li Be B C N O F Ne',&lt;STRONG&gt;strip(element)&lt;/STRONG&gt;,' ','i');
11     put found_at= ;
12     run;

found_at=9
&lt;/PRE&gt;</description>
      <pubDate>Sat, 25 Apr 2026 06:46:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Has-anyone-had-success-with-the-T-modifier-in-FINDW-function/m-p/986788#M379989</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2026-04-25T06:46:08Z</dc:date>
    </item>
  </channel>
</rss>

