<?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 Expanding Frequency tables into datasets in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Expanding-Frequency-tables-into-datasets/m-p/161440#M42018</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good afternoon, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am often given frequency tables which I would like to expand into data sets, which are more easy to manipulate. Is there a procedure that I could use?&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example, I would like to expand the frequency table below into the consequent data set. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;GIVEN&lt;/STRONG&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 255px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl66" height="21" width="75"&gt;&lt;STRONG&gt;Age Group&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD class="xl66" width="88"&gt;&lt;STRONG&gt;Laid off&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD class="xl66" width="92"&gt;&lt;STRONG&gt;Retained&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="21"&gt;up to 40&lt;/TD&gt;&lt;TD class="xl65"&gt;2&lt;/TD&gt;&lt;TD class="xl65"&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="21"&gt;40-49&lt;/TD&gt;&lt;TD class="xl65"&gt;1&lt;/TD&gt;&lt;TD class="xl65"&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;DESIRED OUTCOME&lt;/STRONG&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 176px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl66" height="21" width="88"&gt;&lt;STRONG&gt;Age Group&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD class="xl66" width="88"&gt;&lt;STRONG&gt;Employment&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="21"&gt;Up to 40&lt;/TD&gt;&lt;TD class="xl65"&gt;Laid Off&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="21"&gt;Up to 40&lt;/TD&gt;&lt;TD class="xl65"&gt;Laid Off&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="21"&gt;Up to 40&lt;/TD&gt;&lt;TD class="xl65"&gt;Retained&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="21"&gt;Up to 40&lt;/TD&gt;&lt;TD class="xl65"&gt;Retained&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="21"&gt;Up to 40&lt;/TD&gt;&lt;TD class="xl65"&gt;Retained&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="21"&gt;Up to 40&lt;/TD&gt;&lt;TD class="xl65"&gt;Retained&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="21"&gt;Up to 40&lt;/TD&gt;&lt;TD class="xl65"&gt;Retained&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="21"&gt;40-49&lt;/TD&gt;&lt;TD class="xl65"&gt;Laid Off&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="21"&gt;40-49&lt;/TD&gt;&lt;TD class="xl65"&gt;Retained&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="21"&gt;40-49&lt;/TD&gt;&lt;TD class="xl65"&gt;Retained&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="21"&gt;40-49&lt;/TD&gt;&lt;TD class="xl65"&gt;Retained&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 02 Dec 2013 17:41:38 GMT</pubDate>
    <dc:creator>Greek</dc:creator>
    <dc:date>2013-12-02T17:41:38Z</dc:date>
    <item>
      <title>Expanding Frequency tables into datasets</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Expanding-Frequency-tables-into-datasets/m-p/161440#M42018</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good afternoon, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am often given frequency tables which I would like to expand into data sets, which are more easy to manipulate. Is there a procedure that I could use?&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example, I would like to expand the frequency table below into the consequent data set. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;GIVEN&lt;/STRONG&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 255px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl66" height="21" width="75"&gt;&lt;STRONG&gt;Age Group&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD class="xl66" width="88"&gt;&lt;STRONG&gt;Laid off&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD class="xl66" width="92"&gt;&lt;STRONG&gt;Retained&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="21"&gt;up to 40&lt;/TD&gt;&lt;TD class="xl65"&gt;2&lt;/TD&gt;&lt;TD class="xl65"&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="21"&gt;40-49&lt;/TD&gt;&lt;TD class="xl65"&gt;1&lt;/TD&gt;&lt;TD class="xl65"&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;DESIRED OUTCOME&lt;/STRONG&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 176px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl66" height="21" width="88"&gt;&lt;STRONG&gt;Age Group&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD class="xl66" width="88"&gt;&lt;STRONG&gt;Employment&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="21"&gt;Up to 40&lt;/TD&gt;&lt;TD class="xl65"&gt;Laid Off&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="21"&gt;Up to 40&lt;/TD&gt;&lt;TD class="xl65"&gt;Laid Off&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="21"&gt;Up to 40&lt;/TD&gt;&lt;TD class="xl65"&gt;Retained&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="21"&gt;Up to 40&lt;/TD&gt;&lt;TD class="xl65"&gt;Retained&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="21"&gt;Up to 40&lt;/TD&gt;&lt;TD class="xl65"&gt;Retained&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="21"&gt;Up to 40&lt;/TD&gt;&lt;TD class="xl65"&gt;Retained&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="21"&gt;Up to 40&lt;/TD&gt;&lt;TD class="xl65"&gt;Retained&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="21"&gt;40-49&lt;/TD&gt;&lt;TD class="xl65"&gt;Laid Off&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="21"&gt;40-49&lt;/TD&gt;&lt;TD class="xl65"&gt;Retained&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="21"&gt;40-49&lt;/TD&gt;&lt;TD class="xl65"&gt;Retained&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="21"&gt;40-49&lt;/TD&gt;&lt;TD class="xl65"&gt;Retained&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Dec 2013 17:41:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Expanding-Frequency-tables-into-datasets/m-p/161440#M42018</guid>
      <dc:creator>Greek</dc:creator>
      <dc:date>2013-12-02T17:41:38Z</dc:date>
    </item>
    <item>
      <title>Re: Expanding Frequency tables into datasets</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Expanding-Frequency-tables-into-datasets/m-p/161441#M42019</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;data desired ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp; set given ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp; employment='Laid Off';&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp; do _n_=1 to laid_off ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; output;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp; end;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp; employment='Retained';&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp; do _n_=1 to retained ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; output;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp; end;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;Or you could created a smaller dataset with the a COUNT or FREQ variable.&amp;nbsp; Many procedures will allow you to tell it to use this variable as a weight or frequency.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;data want ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp; set given ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp; employment='Laid Off';&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp; count = laid_off ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp; output;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 10pt; line-height: 1.5em;"&gt;employment='Retained';&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp; count = retained ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp; output;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Dec 2013 17:55:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Expanding-Frequency-tables-into-datasets/m-p/161441#M42019</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2013-12-02T17:55:01Z</dc:date>
    </item>
    <item>
      <title>Re: Expanding Frequency tables into datasets</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Expanding-Frequency-tables-into-datasets/m-p/161442#M42020</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Briliant!&lt;/P&gt;&lt;P&gt;Thank you!~ &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Dec 2013 18:16:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Expanding-Frequency-tables-into-datasets/m-p/161442#M42020</guid>
      <dc:creator>Greek</dc:creator>
      <dc:date>2013-12-02T18:16:39Z</dc:date>
    </item>
  </channel>
</rss>

