<?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: Create dataset from count data? in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Create-dataset-from-count-data/m-p/56893#M15913</link>
    <description>Hello friend,&lt;BR /&gt;
&lt;BR /&gt;
Try checking this code.&lt;BR /&gt;
As Scott suggested the right method to do this. &lt;BR /&gt;
&lt;BR /&gt;
&lt;I&gt;&lt;B&gt;data test;&lt;BR /&gt;
input x y count;&lt;BR /&gt;
cards;&lt;BR /&gt;
1 3 2&lt;BR /&gt;
2 6 4&lt;BR /&gt;
5 4 3&lt;BR /&gt;
;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
data new (drop= i count) ;&lt;BR /&gt;
set test;&lt;BR /&gt;
i=count;&lt;BR /&gt;
do until (i=0);&lt;BR /&gt;
output;&lt;BR /&gt;
i=i-1;&lt;BR /&gt;
end;&lt;BR /&gt;
run;&lt;/B&gt;&lt;/I&gt;&lt;BR /&gt;
&lt;BR /&gt;
Thanks,&lt;BR /&gt;
Saurabh.</description>
    <pubDate>Mon, 15 Feb 2010 06:30:41 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2010-02-15T06:30:41Z</dc:date>
    <item>
      <title>Create dataset from count data?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Create-dataset-from-count-data/m-p/56891#M15911</link>
      <description>Hi&lt;BR /&gt;
&lt;BR /&gt;
I would like to convert a table that contains count data into a dataset that contains individual observations but I'm not sure how&lt;BR /&gt;
&lt;BR /&gt;
For example, I would like to convert a table that looks like this&lt;BR /&gt;
&lt;BR /&gt;
X     Y     count&lt;BR /&gt;
1     3        2&lt;BR /&gt;
2     6        4&lt;BR /&gt;
5     4        3&lt;BR /&gt;
&lt;BR /&gt;
into a dataset that looks like this&lt;BR /&gt;
&lt;BR /&gt;
X     Y&lt;BR /&gt;
1     3&lt;BR /&gt;
1     3&lt;BR /&gt;
2     6&lt;BR /&gt;
2     6&lt;BR /&gt;
2     6&lt;BR /&gt;
2     6&lt;BR /&gt;
5     4&lt;BR /&gt;
5     4&lt;BR /&gt;
5     4&lt;BR /&gt;
&lt;BR /&gt;
Does anyone know of a SAS code that can carry out this conversion?&lt;BR /&gt;
&lt;BR /&gt;
Thanks!</description>
      <pubDate>Sat, 13 Feb 2010 12:08:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Create-dataset-from-count-data/m-p/56891#M15911</guid>
      <dc:creator>sasques</dc:creator>
      <dc:date>2010-02-13T12:08:32Z</dc:date>
    </item>
    <item>
      <title>Re: Create dataset from count data?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Create-dataset-from-count-data/m-p/56892#M15912</link>
      <description>DATA step with a KEEP and SET statement. And you would add a DO UNTIL (&lt;EXPRESSION&gt;); / END; loop containing an OUTPUT statement.  With the expression, you reference variable COUNT.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.&lt;BR /&gt;
&lt;BR /&gt;
Recommended Google advanced search argument, this topic/post:&lt;BR /&gt;
&lt;BR /&gt;
data step programming do loop output site:sas.com&lt;/EXPRESSION&gt;</description>
      <pubDate>Sat, 13 Feb 2010 14:48:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Create-dataset-from-count-data/m-p/56892#M15912</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2010-02-13T14:48:17Z</dc:date>
    </item>
    <item>
      <title>Re: Create dataset from count data?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Create-dataset-from-count-data/m-p/56893#M15913</link>
      <description>Hello friend,&lt;BR /&gt;
&lt;BR /&gt;
Try checking this code.&lt;BR /&gt;
As Scott suggested the right method to do this. &lt;BR /&gt;
&lt;BR /&gt;
&lt;I&gt;&lt;B&gt;data test;&lt;BR /&gt;
input x y count;&lt;BR /&gt;
cards;&lt;BR /&gt;
1 3 2&lt;BR /&gt;
2 6 4&lt;BR /&gt;
5 4 3&lt;BR /&gt;
;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
data new (drop= i count) ;&lt;BR /&gt;
set test;&lt;BR /&gt;
i=count;&lt;BR /&gt;
do until (i=0);&lt;BR /&gt;
output;&lt;BR /&gt;
i=i-1;&lt;BR /&gt;
end;&lt;BR /&gt;
run;&lt;/B&gt;&lt;/I&gt;&lt;BR /&gt;
&lt;BR /&gt;
Thanks,&lt;BR /&gt;
Saurabh.</description>
      <pubDate>Mon, 15 Feb 2010 06:30:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Create-dataset-from-count-data/m-p/56893#M15913</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-02-15T06:30:41Z</dc:date>
    </item>
    <item>
      <title>Re: Create dataset from count data?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Create-dataset-from-count-data/m-p/56894#M15914</link>
      <description>Thanks everyone -- these suggestions are helpful.</description>
      <pubDate>Mon, 15 Feb 2010 07:27:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Create-dataset-from-count-data/m-p/56894#M15914</guid>
      <dc:creator>sasques</dc:creator>
      <dc:date>2010-02-15T07:27:50Z</dc:date>
    </item>
  </channel>
</rss>

