<?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 Merging Proc Freq with a file in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Merging-Proc-Freq-with-a-file/m-p/12976#M201</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It will be easier to answer your question if you provide some sample data and your proc freq code.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 13 Dec 2011 01:10:53 GMT</pubDate>
    <dc:creator>art297</dc:creator>
    <dc:date>2011-12-13T01:10:53Z</dc:date>
    <item>
      <title>Merging Proc Freq with a file</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Merging-Proc-Freq-with-a-file/m-p/12975#M200</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I ran a PROC FREQ by state. The original file contained several rows for state, and the PROC FREQ summed the states into one line. How do I take the PROC FREQ and merge it with an actual file?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for the help!&lt;/P&gt;&lt;P&gt;Nicole&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Dec 2011 01:00:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Merging-Proc-Freq-with-a-file/m-p/12975#M200</guid>
      <dc:creator>Nickley</dc:creator>
      <dc:date>2011-12-13T01:00:18Z</dc:date>
    </item>
    <item>
      <title>Merging Proc Freq with a file</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Merging-Proc-Freq-with-a-file/m-p/12976#M201</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It will be easier to answer your question if you provide some sample data and your proc freq code.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Dec 2011 01:10:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Merging-Proc-Freq-with-a-file/m-p/12976#M201</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2011-12-13T01:10:53Z</dc:date>
    </item>
    <item>
      <title>Merging Proc Freq with a file</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Merging-Proc-Freq-with-a-file/m-p/12977#M202</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="display: block; line-height: normal;"&gt;&lt;SPAN style="color: #000080; font-size: 10pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New';"&gt; walmart7;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New';"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: 'Courier New';"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="display: block; line-height: normal;"&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: 'Courier New';"&gt;set&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New';"&gt; walmartfin1;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New';"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: 'Courier New';"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="display: block; line-height: normal;"&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: 'Courier New';"&gt;where&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New';"&gt; newin1990 = &lt;/SPAN&gt;&lt;STRONG style=": ; color: #008080; font-size: 10pt; font-family: 'Courier New';"&gt;1&lt;/STRONG&gt;&lt;SPAN style="color: #008080; font-size: 10pt; font-family: 'Courier New';"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New';"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New';"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: 'Courier New';"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="display: block; line-height: normal;"&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: 'Courier New';"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New';"&gt; dist gt &lt;/SPAN&gt;&lt;STRONG style=": ; color: #008080; font-size: 10pt; font-family: 'Courier New';"&gt;400&lt;/STRONG&gt;&lt;SPAN style="color: #008080; font-size: 10pt; font-family: 'Courier New';"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New';"&gt; and dist lt &lt;/SPAN&gt;&lt;STRONG style=": ; color: #008080; font-size: 10pt; font-family: 'Courier New';"&gt;800&lt;/STRONG&gt;&lt;SPAN style="color: #008080; font-size: 10pt; font-family: 'Courier New';"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New';"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: 'Courier New';"&gt;then&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New';"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: 'Courier New';"&gt;output&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New';"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New';"&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #000080; font-size: 10pt; font-family: 'Courier New';"&gt; &lt;/STRONG&gt;&lt;SPAN style="color: #000080; font-size: 10pt; font-family: 'Courier New';"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="display: block; line-height: normal;"&gt;&lt;SPAN style="color: #000080; font-size: 10pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New';"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New';"&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #000080; font-size: 10pt; font-family: 'Courier New';"&gt; &lt;/STRONG&gt;&lt;SPAN style="color: #000080; font-size: 10pt; font-family: 'Courier New';"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="display: block; line-height: normal;"&gt;&lt;SPAN style="color: #000080; font-size: 10pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New';"&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #000080; font-size: 10pt; font-family: 'Courier New';"&gt;sort&lt;/STRONG&gt;&lt;SPAN style="color: #000080; font-size: 10pt; font-family: 'Courier New';"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New';"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: 'Courier New';"&gt;data&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New';"&gt; = walmart7;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New';"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="display: block; line-height: normal;"&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: 'Courier New';"&gt;by&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New';"&gt; state;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="display: block; line-height: normal;"&gt;&lt;SPAN style="color: #000080; font-size: 10pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New';"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="display: block; line-height: normal;"&gt;&lt;SPAN style="color: #000080; font-size: 10pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New';"&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #000080; font-size: 10pt; font-family: 'Courier New';"&gt;freq&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New';"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: 'Courier New';"&gt;data&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New';"&gt; = walmart7;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="display: block; line-height: normal;"&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: 'Courier New';"&gt;output&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New';"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="display: block; line-height: normal;"&gt;&lt;SPAN style="color: #000080; font-size: 10pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New';"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Dec 2011 01:14:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Merging-Proc-Freq-with-a-file/m-p/12977#M202</guid>
      <dc:creator>Nickley</dc:creator>
      <dc:date>2011-12-13T01:14:14Z</dc:date>
    </item>
    <item>
      <title>Merging Proc Freq with a file</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Merging-Proc-Freq-with-a-file/m-p/12978#M203</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Using SQL to get the counts in is a bit easier. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Replace have with your table name and it should work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Proc SQL;&lt;/P&gt;&lt;P&gt;create table want as&lt;/P&gt;&lt;P&gt;select *, count(state) as num_obs&lt;/P&gt;&lt;P&gt;from have&lt;/P&gt;&lt;P&gt;group by state;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Dec 2011 01:17:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Merging-Proc-Freq-with-a-file/m-p/12978#M203</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2011-12-13T01:17:18Z</dc:date>
    </item>
    <item>
      <title>Merging Proc Freq with a file</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Merging-Proc-Freq-with-a-file/m-p/12979#M204</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;????????????&lt;/P&gt;&lt;P&gt;That proc freq won't produce anything.&amp;nbsp; And, by data, I meant a datastep that produces a small subset of what your data really look like.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Dec 2011 01:18:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Merging-Proc-Freq-with-a-file/m-p/12979#M204</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2011-12-13T01:18:26Z</dc:date>
    </item>
    <item>
      <title>Merging Proc Freq with a file</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Merging-Proc-Freq-with-a-file/m-p/12980#M205</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What about the PROC FREQ output do you want to merge back onto the original data? &lt;/P&gt;&lt;P&gt;Do you want the count of the number of records per state?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc freq data=walmart7 ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; tables state / out=counts ;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; merge counts walmart7 ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; by state ;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Dec 2011 01:27:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Merging-Proc-Freq-with-a-file/m-p/12980#M205</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2011-12-13T01:27:12Z</dc:date>
    </item>
    <item>
      <title>Merging Proc Freq with a file</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Merging-Proc-Freq-with-a-file/m-p/12981#M206</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Tom, &lt;/P&gt;&lt;P&gt;This is very helpful, thank you for your help! I have one additional question if you have the time. In the table, the state of Alabama shows up in 67 rows. Do you know how I would go about getting one row per state?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again for your help,&lt;/P&gt;&lt;P&gt;Nicole&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Dec 2011 01:33:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Merging-Proc-Freq-with-a-file/m-p/12981#M206</guid>
      <dc:creator>Nickley</dc:creator>
      <dc:date>2011-12-13T01:33:26Z</dc:date>
    </item>
    <item>
      <title>Merging Proc Freq with a file</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Merging-Proc-Freq-with-a-file/m-p/12982#M207</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;But which of the 67 rows do you want?&amp;nbsp; &lt;/P&gt;&lt;P&gt;Perhaps you want to summarize the 67 rows?&lt;/P&gt;&lt;P&gt;You might consider PROC SUMMARY (also known as PROC MEANS).&lt;/P&gt;&lt;P&gt;For example to get the mean of all the numeric variables (like the two mentioned above in your example code).&lt;/P&gt;&lt;P&gt;You can use a CLASS statement even if the data is not sorted by that variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc summary data=walmart7 nway ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; class state ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; var _numeric_ ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; output out=means mean= ;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Dec 2011 02:52:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Merging-Proc-Freq-with-a-file/m-p/12982#M207</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2011-12-13T02:52:59Z</dc:date>
    </item>
  </channel>
</rss>

