<?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: sas programming in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/sas-programming/m-p/243983#M268496</link>
    <description>&lt;P&gt;Read the categories one by one until the end of each line:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data t;
infile datalines truncover;
input sno category :$20. @;
do until(missing(category));
    output;
    input category :$20. @;
    end;
datalines;
1 dairy floor eggs
2 floor milk
3 eggs bread
4 bread butter butter
;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sat, 16 Jan 2016 04:01:26 GMT</pubDate>
    <dc:creator>PGStats</dc:creator>
    <dc:date>2016-01-16T04:01:26Z</dc:date>
    <item>
      <title>sas programming</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sas-programming/m-p/243977#M268493</link>
      <description>&lt;P&gt;data t;&lt;BR /&gt;input sno category$ 20.;&lt;BR /&gt;cards;&lt;BR /&gt;1 dairy floor eggs&lt;BR /&gt;2 floor milk&lt;BR /&gt;3 eggs bread&lt;BR /&gt;4 bread butter butter&lt;BR /&gt;;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i have this data set and i want distinct category (dairy,floor,eggs,milk,bread,butter).&lt;/P&gt;&lt;P&gt;I can do like this&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;data t1;&lt;BR /&gt;set t;&lt;BR /&gt;do i=1 to 3;&lt;BR /&gt;x=scan(category,i);&lt;BR /&gt;output;&lt;BR /&gt;end;&lt;BR /&gt;run;&lt;BR /&gt;proc print;run;&lt;/P&gt;&lt;P&gt;but here i dnt knw how many times i have to run the loop like 3 or 4 or 5 times.Any optimum way?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Jan 2016 03:44:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sas-programming/m-p/243977#M268493</guid>
      <dc:creator>pawandh</dc:creator>
      <dc:date>2016-01-16T03:44:17Z</dc:date>
    </item>
    <item>
      <title>Re: sas programming</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sas-programming/m-p/243981#M268494</link>
      <description>Countw() will count number of words in a variable. Use that to create a variable that holds the number of iterations and use it in your do loop.</description>
      <pubDate>Sat, 16 Jan 2016 03:57:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sas-programming/m-p/243981#M268494</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-01-16T03:57:31Z</dc:date>
    </item>
    <item>
      <title>Re: sas programming</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sas-programming/m-p/243982#M268495</link>
      <description>&lt;P&gt;data t1;&lt;/P&gt;
&lt;P&gt;set t;&lt;BR /&gt;do i=1 to &lt;STRONG&gt;countw(category);&lt;/STRONG&gt;&lt;BR /&gt;x=scan(category,i);&lt;BR /&gt;output;&lt;BR /&gt;end;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Jan 2016 03:57:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sas-programming/m-p/243982#M268495</guid>
      <dc:creator>stat_sas</dc:creator>
      <dc:date>2016-01-16T03:57:54Z</dc:date>
    </item>
    <item>
      <title>Re: sas programming</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sas-programming/m-p/243983#M268496</link>
      <description>&lt;P&gt;Read the categories one by one until the end of each line:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data t;
infile datalines truncover;
input sno category :$20. @;
do until(missing(category));
    output;
    input category :$20. @;
    end;
datalines;
1 dairy floor eggs
2 floor milk
3 eggs bread
4 bread butter butter
;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 16 Jan 2016 04:01:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sas-programming/m-p/243983#M268496</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2016-01-16T04:01:26Z</dc:date>
    </item>
  </channel>
</rss>

