<?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 freq totals only in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Proc-freq-totals-only/m-p/569072#M160312</link>
    <description>&lt;P&gt;Based on the way you expect the output to appear:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;Without having each employee ID spread out horizontally with the count of records for each, i just want the distinct total of employees per department with records.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It doesn't sounds like you want a two-way frequency table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Using this dummy data:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA WORK.HAVE;
FORMAT Dept $20.	Employee $20.;
INPUT  Dept	    	Employee;
INFILE DATALINES DLM='|' DSD;
DATALINES;
Human Resources|Adam Apple
Accounting|Bill Bobington
Accounting|Chuck Cooper
Accounting|Donna Dillard
Human Resources|Edward Ekins
Sales|Fred Flintstone
;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I used this PROC FREQ logic to generate a list of all of the departments and a distinct count of employees for each department.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC FREQ DATA=WORK.HAVE;   TABLES Dept   /LIST MISSING NOPERCENT NOCUM;   RUN;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;And the resulting output that printed was this:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Dept           Frequency 
Accounting      3 
Human Resources 2 
Sales           1 &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;A list of all of the departments from the dataset and a distinct count of the total employees from that department.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If this isn't what you were looking for, please provide some additional details (like dummy data that aligns to your actual dataset, a visual representation of what your expectations are for the final output, etc).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 26 Jun 2019 12:50:19 GMT</pubDate>
    <dc:creator>tsap</dc:creator>
    <dc:date>2019-06-26T12:50:19Z</dc:date>
    <item>
      <title>Proc freq totals only</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-freq-totals-only/m-p/568960#M160262</link>
      <description>&lt;P&gt;I would like to do a two way proc freq table showing a list of all the departments, and then a distinct count of the employees that are a part of each department.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Without having each employee ID spread out horizontally with the count of records for each, i just want the distinct total of employees per department with records.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jun 2019 00:07:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-freq-totals-only/m-p/568960#M160262</guid>
      <dc:creator>shoeGirl32</dc:creator>
      <dc:date>2019-06-26T00:07:28Z</dc:date>
    </item>
    <item>
      <title>Re: Proc freq totals only</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-freq-totals-only/m-p/569072#M160312</link>
      <description>&lt;P&gt;Based on the way you expect the output to appear:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;Without having each employee ID spread out horizontally with the count of records for each, i just want the distinct total of employees per department with records.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It doesn't sounds like you want a two-way frequency table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Using this dummy data:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA WORK.HAVE;
FORMAT Dept $20.	Employee $20.;
INPUT  Dept	    	Employee;
INFILE DATALINES DLM='|' DSD;
DATALINES;
Human Resources|Adam Apple
Accounting|Bill Bobington
Accounting|Chuck Cooper
Accounting|Donna Dillard
Human Resources|Edward Ekins
Sales|Fred Flintstone
;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I used this PROC FREQ logic to generate a list of all of the departments and a distinct count of employees for each department.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC FREQ DATA=WORK.HAVE;   TABLES Dept   /LIST MISSING NOPERCENT NOCUM;   RUN;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;And the resulting output that printed was this:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Dept           Frequency 
Accounting      3 
Human Resources 2 
Sales           1 &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;A list of all of the departments from the dataset and a distinct count of the total employees from that department.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If this isn't what you were looking for, please provide some additional details (like dummy data that aligns to your actual dataset, a visual representation of what your expectations are for the final output, etc).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jun 2019 12:50:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-freq-totals-only/m-p/569072#M160312</guid>
      <dc:creator>tsap</dc:creator>
      <dc:date>2019-06-26T12:50:19Z</dc:date>
    </item>
  </channel>
</rss>

