<?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 array issue with FINDW in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/array-issue-with-FINDW/m-p/44450#M11756</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok, just realized what the problem was. I had forgot to trim the word...Now it works.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/*Example*/ &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA Example;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;INPUT Texts $CHAR60.;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATALINES;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The number of times "the" appears is the question&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;THE the&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;None on this line&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is the map&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA Example;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;set Example;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* Load Words into a one-dimensional array*/&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;length words1-words3 $20;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;array words{3} words1-words3;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;retain words1-words3;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* Load position of word into a one-dimensional array*/&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;length posw1-posw3 6;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;array posw{3} posw1-posw3;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;retain posw1-posw3;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;words1="the";&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;words2="number";&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;words3="line";&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;do i=1 to 3;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; posw{i}=findw(texts,&lt;STRONG&gt;trim&lt;/STRONG&gt;(words{i}),' ','E'); &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/*Define validation variable that uses the typical format of the FINDW function*/&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;m=findw(texts,"the",' ','E');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;keep texts posw1 m;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;run; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 27 Mar 2012 10:34:07 GMT</pubDate>
    <dc:creator>dio</dc:creator>
    <dc:date>2012-03-27T10:34:07Z</dc:date>
    <item>
      <title>array issue with FINDW</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/array-issue-with-FINDW/m-p/44449#M11755</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i seem to not be able to specify the word argument of the FINDW function as an array. I have a list of words and I am trying to find the position of these words in a list of texts with the FINDW function and the 'E' modifier. However, the function returns position 0 when i specify the word argument and the output variable as arrays, whereas it works perfectly fine in its typical form. Would really appreciate your ideas on why this goes wrong.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/*Example*/ &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA Example;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;INPUT Texts $CHAR60.;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATALINES;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The number of times "the" appears is the question&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;THE the&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;None on this line&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is the map&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA Example;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;set Example;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* Load Words into a one-dimensional array*/&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;length words1-words3 $20;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;array words{3} words1-words3;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;retain words1-words3;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* Load position of word into a one-dimensional array*/&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;length posw1-posw3 6;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;array posw{3} posw1-posw3;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;retain posw1-posw3;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;words1="the";&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;words2="number";&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;words3="line";&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;do i=1 to 3;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; posw{i}=findw(texts,words{i},' ','E'); &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/*Define validation variable that uses the typical format of the FINDW function*/&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;m=findw(texts,"the",' ','E');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;keep texts posw1 m;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;run; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Mar 2012 10:27:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/array-issue-with-FINDW/m-p/44449#M11755</guid>
      <dc:creator>dio</dc:creator>
      <dc:date>2012-03-27T10:27:18Z</dc:date>
    </item>
    <item>
      <title>array issue with FINDW</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/array-issue-with-FINDW/m-p/44450#M11756</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok, just realized what the problem was. I had forgot to trim the word...Now it works.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/*Example*/ &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA Example;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;INPUT Texts $CHAR60.;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATALINES;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The number of times "the" appears is the question&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;THE the&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;None on this line&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is the map&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA Example;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;set Example;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* Load Words into a one-dimensional array*/&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;length words1-words3 $20;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;array words{3} words1-words3;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;retain words1-words3;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* Load position of word into a one-dimensional array*/&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;length posw1-posw3 6;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;array posw{3} posw1-posw3;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;retain posw1-posw3;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;words1="the";&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;words2="number";&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;words3="line";&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;do i=1 to 3;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; posw{i}=findw(texts,&lt;STRONG&gt;trim&lt;/STRONG&gt;(words{i}),' ','E'); &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/*Define validation variable that uses the typical format of the FINDW function*/&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;m=findw(texts,"the",' ','E');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;keep texts posw1 m;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;run; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Mar 2012 10:34:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/array-issue-with-FINDW/m-p/44450#M11756</guid>
      <dc:creator>dio</dc:creator>
      <dc:date>2012-03-27T10:34:07Z</dc:date>
    </item>
  </channel>
</rss>

