<?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: find the next word in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/find-the-next-word/m-p/179877#M34367</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Haikuo:&lt;/P&gt;&lt;P&gt;When I run your code I get an error: No DATALINES or INFILE statement. But If I remove the input statement in the data _null_ step I get the same result without the error message.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 20 Dec 2013 20:30:54 GMT</pubDate>
    <dc:creator>CTorres</dc:creator>
    <dc:date>2013-12-20T20:30:54Z</dc:date>
    <item>
      <title>find the next word</title>
      <link>https://communities.sas.com/t5/SAS-Programming/find-the-next-word/m-p/179872#M34362</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a .lst file that contain information similar to what’s below. &lt;/P&gt;&lt;P&gt;I want to keep&amp;nbsp; the number next to the word LABEL. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Varname len1 len2 l&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; abel&amp;nbsp;&amp;nbsp; ndif&amp;nbsp;&amp;nbsp;&amp;nbsp; maxdif &lt;/P&gt;&lt;P&gt;Aaaa&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LABEL&amp;nbsp;&amp;nbsp; 4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .01&lt;/P&gt;&lt;P&gt;BBBB&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LABEL&amp;nbsp;&amp;nbsp; 5&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to keep only&amp;nbsp; &lt;/P&gt;&lt;P&gt;AAAA 4&lt;/P&gt;&lt;P&gt;BBBB&amp;nbsp; 5&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I should I do this in SAS?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Dec 2013 18:55:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/find-the-next-word/m-p/179872#M34362</guid>
      <dc:creator>zqkal</dc:creator>
      <dc:date>2013-12-20T18:55:05Z</dc:date>
    </item>
    <item>
      <title>Re: find the next word</title>
      <link>https://communities.sas.com/t5/SAS-Programming/find-the-next-word/m-p/179873#M34363</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Read the file into a dataset, then use a keep statement to keep the variables you want.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Dec 2013 19:11:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/find-the-next-word/m-p/179873#M34363</guid>
      <dc:creator>Fugue</dc:creator>
      <dc:date>2013-12-20T19:11:34Z</dc:date>
    </item>
    <item>
      <title>Re: find the next word</title>
      <link>https://communities.sas.com/t5/SAS-Programming/find-the-next-word/m-p/179874#M34364</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;filename test "c:\art\test.lst";&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/*create .lst file*/&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;&amp;nbsp; file test;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input;&lt;/P&gt;&lt;P&gt;&amp;nbsp; put _infile_;&lt;/P&gt;&lt;P&gt;&amp;nbsp; cards;&lt;/P&gt;&lt;P&gt;Varname len1 len2 l&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; abel&amp;nbsp;&amp;nbsp; ndif&amp;nbsp;&amp;nbsp;&amp;nbsp; maxdif&lt;/P&gt;&lt;P&gt;Aaaa&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LABEL&amp;nbsp;&amp;nbsp; 4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .01&lt;/P&gt;&lt;P&gt;BBBB&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LABEL&amp;nbsp;&amp;nbsp; 5&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.2&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;&amp;nbsp; infile test firstobs=2;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input varname $@;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input @"LABEL" ndif;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Dec 2013 19:22:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/find-the-next-word/m-p/179874#M34364</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2013-12-20T19:22:58Z</dc:date>
    </item>
    <item>
      <title>Re: find the next word</title>
      <link>https://communities.sas.com/t5/SAS-Programming/find-the-next-word/m-p/179875#M34365</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That was super slick, Art. I know your solution is probably close to what OP want, but here is a trick from &lt;A __default_attr="177609" __jive_macro_name="message" class="jive_macro jive_macro_message" data-objecttype="2" href="https://communities.sas.com/"&gt;&lt;/A&gt; using Parmcards to make a stream-in data flow:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;filename ft15f001 temp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input;&lt;/P&gt;&lt;P&gt;&amp;nbsp; parmcards;&lt;/P&gt;&lt;P&gt;Varname len1 len2 l abel ndif maxdif&lt;/P&gt;&lt;P&gt;Aaaa 1 1 LABEL 4 .01&lt;/P&gt;&lt;P&gt;BBBB 2 2 LABEL 5 0.2&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;&amp;nbsp; infile ft15f001 firstobs=2;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input varname $@;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input @"LABEL" ndif;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Haikuo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Dec 2013 19:45:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/find-the-next-word/m-p/179875#M34365</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2013-12-20T19:45:15Z</dc:date>
    </item>
    <item>
      <title>Re: find the next word</title>
      <link>https://communities.sas.com/t5/SAS-Programming/find-the-next-word/m-p/179876#M34366</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Possible thought: That looks like the output from proc compare, you can capture that using ODS statements and parse as well, instead of reading in the LST files. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Dec 2013 19:53:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/find-the-next-word/m-p/179876#M34366</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2013-12-20T19:53:16Z</dc:date>
    </item>
    <item>
      <title>Re: find the next word</title>
      <link>https://communities.sas.com/t5/SAS-Programming/find-the-next-word/m-p/179877#M34367</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Haikuo:&lt;/P&gt;&lt;P&gt;When I run your code I get an error: No DATALINES or INFILE statement. But If I remove the input statement in the data _null_ step I get the same result without the error message.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Dec 2013 20:30:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/find-the-next-word/m-p/179877#M34367</guid>
      <dc:creator>CTorres</dc:creator>
      <dc:date>2013-12-20T20:30:54Z</dc:date>
    </item>
    <item>
      <title>Re: find the next word</title>
      <link>https://communities.sas.com/t5/SAS-Programming/find-the-next-word/m-p/179878#M34368</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you are correct. It runs through even without data _null_;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;filename ft15f001 temp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; parmcards;&lt;/P&gt;&lt;P&gt;Varname len1 len2 l abel ndif maxdif&lt;/P&gt;&lt;P&gt;Aaaa 1 1 LABEL 4 .01&lt;/P&gt;&lt;P&gt;BBBB 2 2 LABEL 5 0.2&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want3;&lt;/P&gt;&lt;P&gt;&amp;nbsp; infile ft15f001 firstobs=2;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input varname $@;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input @"LABEL" ndif;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Haikuo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Dec 2013 20:37:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/find-the-next-word/m-p/179878#M34368</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2013-12-20T20:37:28Z</dc:date>
    </item>
    <item>
      <title>Re: find the next word</title>
      <link>https://communities.sas.com/t5/SAS-Programming/find-the-next-word/m-p/179879#M34369</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A __default_attr="5068" __jive_macro_name="user" class="jive_macro jive_macro_user" data-objecttype="3" href="https://communities.sas.com/"&gt;&lt;/A&gt;: The one thing you didn't criticize me for, but should have, is that my proposed code could be simplified to just:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;&amp;nbsp; infile "c:\art\test.lst" firstobs=2;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input varname $ @"LABEL" ndif;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Dec 2013 22:29:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/find-the-next-word/m-p/179879#M34369</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2013-12-20T22:29:53Z</dc:date>
    </item>
    <item>
      <title>Re: find the next word</title>
      <link>https://communities.sas.com/t5/SAS-Programming/find-the-next-word/m-p/179880#M34370</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Reeza, you'r right it is result from proc compare. I have used ODS feature to capture the result&amp;nbsp; into a dataset. However, I’m having problem parsing the data because of SAs limitation to put each variable into its own variable.&amp;nbsp; SAS created two variable (batch and type) and if the ndif is longer than 6 digits it puts len2 with ndif.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Dec 2013 23:00:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/find-the-next-word/m-p/179880#M34370</guid>
      <dc:creator>zqkal</dc:creator>
      <dc:date>2013-12-20T23:00:29Z</dc:date>
    </item>
    <item>
      <title>Re: find the next word</title>
      <link>https://communities.sas.com/t5/SAS-Programming/find-the-next-word/m-p/179881#M34371</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you only want the NDIF then use the outstats table filtered, and you can even filter out for only ones that are not equal to 0, though I haven't done that below.&lt;/P&gt;&lt;P&gt;SAS 9.3 :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data class;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; set sashelp.class;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if age=14 then weight=0;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc compare data=sashelp.class compare=class outstats=check (where=(_type_="NDIF"));&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Dec 2013 23:17:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/find-the-next-word/m-p/179881#M34371</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2013-12-20T23:17:35Z</dc:date>
    </item>
  </channel>
</rss>

