<?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: DataStep and Proc SQL in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/DataStep-and-Proc-SQL/m-p/75282#M16220</link>
    <description>Using PROC FREQ the syntax will be more concise.&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
ods select Freq.NLevels;&lt;BR /&gt;
ods output Freq.NLevels=Nlevels;&lt;BR /&gt;
proc freq data=sample levels;&lt;BR /&gt;
   run;&lt;BR /&gt;
ods select all;&lt;BR /&gt;
Proc print;&lt;BR /&gt;
   run;&lt;BR /&gt;
[/pre]</description>
    <pubDate>Tue, 24 Feb 2009 14:33:05 GMT</pubDate>
    <dc:creator>data_null__</dc:creator>
    <dc:date>2009-02-24T14:33:05Z</dc:date>
    <item>
      <title>DataStep and Proc SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/DataStep-and-Proc-SQL/m-p/75281#M16219</link>
      <description>Hi All, &lt;BR /&gt;
&lt;BR /&gt;
I have a dataset with approx 30 variables and I want to find out number of unique observation count for each variable&lt;BR /&gt;
&lt;BR /&gt;
For ex:&lt;BR /&gt;
&lt;BR /&gt;
data sample;&lt;BR /&gt;
input empid sal name$;&lt;BR /&gt;
cards;&lt;BR /&gt;
101 1000 aaa&lt;BR /&gt;
102 2000 bbb&lt;BR /&gt;
103 2000 ccc&lt;BR /&gt;
104 1000 ddd&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
proc sql;&lt;BR /&gt;
create table count as&lt;BR /&gt;
select count(distinct(empid)) as count_eid,&lt;BR /&gt;
count(distinct(sal)) as count_sal,&lt;BR /&gt;
count(distinct(name)) as count_name&lt;BR /&gt;
from sample;&lt;BR /&gt;
quit;&lt;BR /&gt;
&lt;BR /&gt;
the above query results to &lt;BR /&gt;
4, 2 and 4&lt;BR /&gt;
&lt;BR /&gt;
My problem is i want to automate the query rather than writing all the 30 variables in select query.&lt;BR /&gt;
&lt;BR /&gt;
so, please reply me ASAP.</description>
      <pubDate>Tue, 24 Feb 2009 11:43:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/DataStep-and-Proc-SQL/m-p/75281#M16219</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-02-24T11:43:19Z</dc:date>
    </item>
    <item>
      <title>Re: DataStep and Proc SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/DataStep-and-Proc-SQL/m-p/75282#M16220</link>
      <description>Using PROC FREQ the syntax will be more concise.&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
ods select Freq.NLevels;&lt;BR /&gt;
ods output Freq.NLevels=Nlevels;&lt;BR /&gt;
proc freq data=sample levels;&lt;BR /&gt;
   run;&lt;BR /&gt;
ods select all;&lt;BR /&gt;
Proc print;&lt;BR /&gt;
   run;&lt;BR /&gt;
[/pre]</description>
      <pubDate>Tue, 24 Feb 2009 14:33:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/DataStep-and-Proc-SQL/m-p/75282#M16220</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2009-02-24T14:33:05Z</dc:date>
    </item>
  </channel>
</rss>

