<?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: proc univariate, output columns to existing database in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/proc-univariate-output-columns-to-existing-database/m-p/161284#M41992</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your syntax will replace your existing dataset with calculated summary stats. To add stats in your original data set save stats to another dataset (want) and merge back to original one to get desired dataset (final).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc &lt;STRONG style="color: #000080; font-family: Courier New; font-size: 10pt;"&gt;univariate&lt;/STRONG&gt;&lt;SPAN style="font-family: Courier New; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-family: Courier New; font-size: 10pt;"&gt;data&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New; font-size: 10pt;"&gt;=existing;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Courier New; font-size: 10pt;"&gt; var a b c;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Courier New; font-size: 10pt;"&gt; output &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-family: Courier New; font-size: 10pt;"&gt;out&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New; font-size: 10pt;"&gt;=&lt;STRONG&gt;want &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-family: Courier New; font-size: 10pt;"&gt;sum&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New; font-size: 10pt;"&gt;=Asum Bsum Csum N=Act Bct Cct&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Courier New; font-size: 10pt;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data final;&lt;/P&gt;&lt;P&gt;if _n_=1 then set want;&lt;/P&gt;&lt;P&gt;set have;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 14 Aug 2014 16:33:47 GMT</pubDate>
    <dc:creator>stat_sas</dc:creator>
    <dc:date>2014-08-14T16:33:47Z</dc:date>
    <item>
      <title>proc univariate, output columns to existing database</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-univariate-output-columns-to-existing-database/m-p/161283#M41991</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; proc &lt;/SPAN&gt;&lt;STRONG style=": ; color: #000080; font-size: 10pt; font-family: Courier New;"&gt;univariate&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;=existing;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; var a b c;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; output &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;out&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;=existing &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;=Asum Bsum Csum N=Act Bct Cct&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;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;I already have an existing dataset with 10 variables. I want to add the additional 6 variables from the proc univariate procedure but when I use the output statement, it overwrites all the existing variables instead of adding additional columns.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;How can I make so it so that the outputs I want (sum and N) are added to an existing dataset?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;Thank you very much.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Aug 2014 16:12:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-univariate-output-columns-to-existing-database/m-p/161283#M41991</guid>
      <dc:creator>peer</dc:creator>
      <dc:date>2014-08-14T16:12:36Z</dc:date>
    </item>
    <item>
      <title>Re: proc univariate, output columns to existing database</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-univariate-output-columns-to-existing-database/m-p/161284#M41992</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your syntax will replace your existing dataset with calculated summary stats. To add stats in your original data set save stats to another dataset (want) and merge back to original one to get desired dataset (final).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc &lt;STRONG style="color: #000080; font-family: Courier New; font-size: 10pt;"&gt;univariate&lt;/STRONG&gt;&lt;SPAN style="font-family: Courier New; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-family: Courier New; font-size: 10pt;"&gt;data&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New; font-size: 10pt;"&gt;=existing;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Courier New; font-size: 10pt;"&gt; var a b c;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Courier New; font-size: 10pt;"&gt; output &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-family: Courier New; font-size: 10pt;"&gt;out&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New; font-size: 10pt;"&gt;=&lt;STRONG&gt;want &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-family: Courier New; font-size: 10pt;"&gt;sum&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New; font-size: 10pt;"&gt;=Asum Bsum Csum N=Act Bct Cct&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Courier New; font-size: 10pt;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data final;&lt;/P&gt;&lt;P&gt;if _n_=1 then set want;&lt;/P&gt;&lt;P&gt;set have;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Aug 2014 16:33:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-univariate-output-columns-to-existing-database/m-p/161284#M41992</guid>
      <dc:creator>stat_sas</dc:creator>
      <dc:date>2014-08-14T16:33:47Z</dc:date>
    </item>
  </channel>
</rss>

