<?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: Help with create a summary of distinct value for each variable in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Help-with-create-a-summary-of-distinct-value-for-each-variable/m-p/154237#M298629</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;something like&lt;/P&gt;&lt;P&gt;proc summary missing data= your.data ;&lt;/P&gt;&lt;P&gt;class _all_ ;&lt;/P&gt;&lt;P&gt;output out= results ;&lt;/P&gt;&lt;P&gt;run ;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 28 Jan 2014 21:27:25 GMT</pubDate>
    <dc:creator>Peter_C</dc:creator>
    <dc:date>2014-01-28T21:27:25Z</dc:date>
    <item>
      <title>Help with create a summary of distinct value for each variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-with-create-a-summary-of-distinct-value-for-each-variable/m-p/154233#M298625</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a dataset with n variables. I want to create a summary file of distinct/unique values for each variables.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;data have;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input a0 a1 a2 a3 a4 a5 a6;&lt;/P&gt;&lt;P&gt;&amp;nbsp; datalines;&lt;/P&gt;&lt;P&gt;0 5 9 1 0 8 1&lt;/P&gt;&lt;P&gt;1 4 0 1 0 5 0&lt;/P&gt;&lt;P&gt;1 8 0 1 0 1 1&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;as you see, a0 only take value 0 or 1; a1 values are 5 4 8; a2 values are 9 and 0; a3 take only value 1...&lt;/P&gt;&lt;P&gt;The output file should be:&lt;BR /&gt;a0 a1 a2 a3 a4 ...&lt;BR /&gt;1&amp;nbsp; 5&amp;nbsp; 9&amp;nbsp; 1&amp;nbsp; 0...&lt;BR /&gt;0&amp;nbsp; 4&amp;nbsp; 0&lt;BR /&gt;&amp;nbsp;&amp;nbsp; 8&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I wonder if there is any simple way to get it done. Right now I can only do it through sort nondupkey one by one and merge, which is not efficient.&lt;/P&gt;&lt;P&gt;Thank you so much for your help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HHC&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Jan 2014 13:26:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-with-create-a-summary-of-distinct-value-for-each-variable/m-p/154233#M298625</guid>
      <dc:creator>hhchenfx</dc:creator>
      <dc:date>2014-01-28T13:26:20Z</dc:date>
    </item>
    <item>
      <title>Re: Help with create a summary of value for each variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-with-create-a-summary-of-distinct-value-for-each-variable/m-p/154234#M298626</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not really summary, rather distinct values?&lt;/P&gt;&lt;P&gt;Without knowing the underlying requirement, it seems like an odd request.&lt;/P&gt;&lt;P&gt;However, I would transpose the data, and the do select distinct/proc sort nodupkey. And if it's really necessary, transpose it back..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Jan 2014 13:39:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-with-create-a-summary-of-distinct-value-for-each-variable/m-p/154234#M298626</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2014-01-28T13:39:54Z</dc:date>
    </item>
    <item>
      <title>Re: Help with create a summary of distinct value for each variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-with-create-a-summary-of-distinct-value-for-each-variable/m-p/154235#M298627</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This looks about right.&lt;/P&gt;&lt;DIV style="font-family: Courier New; font-size: 9pt;"&gt;&lt;STRONG style="color: #000080; background-color: #ffffff;"&gt;data&lt;/STRONG&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; have;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;input&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; a0 a1 a2 a3 a4 a5 a6;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;datalines&lt;/SPAN&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffc0;"&gt;0 5 9 1 0 8 1&lt;BR /&gt;1 4 0 1 0 5 0&lt;BR /&gt;1 8 0 1 0 1 1&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;;;;;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;STRONG style="color: #000080; background-color: #ffffff;"&gt;run&lt;/STRONG&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #000080; background-color: #ffffff;"&gt;proc&lt;/STRONG&gt; &lt;STRONG style="color: #000080; background-color: #ffffff;"&gt;summary&lt;/STRONG&gt; &lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;data&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;=have &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;missing&lt;/SPAN&gt; &lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;chartype&lt;/SPAN&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;class&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; a:;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;ways&lt;/SPAN&gt; &lt;STRONG style="color: #008080; background-color: #ffffff;"&gt;1&lt;/STRONG&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;output&lt;/SPAN&gt; &lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;out&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;=distinct(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;drop&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;=_type_ _freq_) / &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;levels&lt;/SPAN&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;STRONG style="color: #000080; background-color: #ffffff;"&gt;run&lt;/STRONG&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #000080; background-color: #ffffff;"&gt;proc&lt;/STRONG&gt; &lt;STRONG style="color: #000080; background-color: #ffffff;"&gt;print&lt;/STRONG&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;STRONG style="color: #000080; background-color: #ffffff;"&gt;run&lt;/STRONG&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #000080; background-color: #ffffff;"&gt;proc&lt;/STRONG&gt; &lt;STRONG style="color: #000080; background-color: #ffffff;"&gt;sort&lt;/STRONG&gt; &lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;data&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;=distinct;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;by&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; _level_;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;STRONG style="color: #000080; background-color: #ffffff;"&gt;run&lt;/STRONG&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #000080; background-color: #ffffff;"&gt;data&lt;/STRONG&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; flat;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;update&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; distinct(obs=&lt;/SPAN&gt;&lt;STRONG style="color: #008080; background-color: #ffffff;"&gt;0&lt;/STRONG&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;) distinct;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;by&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; _level_;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;STRONG style="color: #000080; background-color: #ffffff;"&gt;run&lt;/STRONG&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #000080; background-color: #ffffff;"&gt;proc&lt;/STRONG&gt; &lt;STRONG style="color: #000080; background-color: #ffffff;"&gt;print&lt;/STRONG&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;STRONG style="color: #000080; background-color: #ffffff;"&gt;run&lt;/STRONG&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Jan 2014 14:40:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-with-create-a-summary-of-distinct-value-for-each-variable/m-p/154235#M298627</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2014-01-28T14:40:47Z</dc:date>
    </item>
    <item>
      <title>Re: Help with create a summary of distinct value for each variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-with-create-a-summary-of-distinct-value-for-each-variable/m-p/154236#M298628</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you so much, Data_null !!!&lt;BR /&gt;One quick question since you are here. If the name of variables shares nothing in common, say a1, f4, var1, date... I cannot use the "class a: ;" .&lt;/P&gt;&lt;P&gt;What should we put after "class" so that SAS conduct the proc summary for all variables on the file?&lt;/P&gt;&lt;P&gt;Thank you again,&lt;/P&gt;&lt;P&gt;HHC&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Jan 2014 21:07:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-with-create-a-summary-of-distinct-value-for-each-variable/m-p/154236#M298628</guid>
      <dc:creator>hhchenfx</dc:creator>
      <dc:date>2014-01-28T21:07:19Z</dc:date>
    </item>
    <item>
      <title>Re: Help with create a summary of distinct value for each variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-with-create-a-summary-of-distinct-value-for-each-variable/m-p/154237#M298629</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;something like&lt;/P&gt;&lt;P&gt;proc summary missing data= your.data ;&lt;/P&gt;&lt;P&gt;class _all_ ;&lt;/P&gt;&lt;P&gt;output out= results ;&lt;/P&gt;&lt;P&gt;run ;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Jan 2014 21:27:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-with-create-a-summary-of-distinct-value-for-each-variable/m-p/154237#M298629</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2014-01-28T21:27:25Z</dc:date>
    </item>
    <item>
      <title>Re: Help with create a summary of distinct value for each variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-with-create-a-summary-of-distinct-value-for-each-variable/m-p/154238#M298630</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Like &lt;A __default_attr="392339" __jive_macro_name="user" class="jive_macro jive_macro_user" data-objecttype="3" href="https://communities.sas.com/"&gt;&lt;/A&gt; says you can use _ALL_&amp;nbsp; a&amp;nbsp; &lt;A href="http://support.sas.com/documentation/cdl/en/lrcon/67227/HTML/default/viewer.htm#p0wphcpsfgx6o7n1sjtqzizp1n39.htm"&gt;SAS Variable List&lt;/A&gt; one of the most power features of the SAS language.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Jan 2014 22:58:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-with-create-a-summary-of-distinct-value-for-each-variable/m-p/154238#M298630</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2014-01-28T22:58:44Z</dc:date>
    </item>
    <item>
      <title>Re: Help with create a summary of distinct value for each variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-with-create-a-summary-of-distinct-value-for-each-variable/m-p/154239#M298631</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you, Peter and Data_null_.&lt;/P&gt;&lt;P&gt;Lesson learned.&lt;/P&gt;&lt;P&gt;HHC&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Jan 2014 00:48:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-with-create-a-summary-of-distinct-value-for-each-variable/m-p/154239#M298631</guid>
      <dc:creator>hhchenfx</dc:creator>
      <dc:date>2014-01-29T00:48:31Z</dc:date>
    </item>
  </channel>
</rss>

