<?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: Function freq and not proc freq in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Function-freq-and-not-proc-freq/m-p/448662#M112877</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;SELECT t1.Name, t1.ID, 
          count(t1.description) AS Number
      FROM WORK.TOTAL t1 
      where t1.description eq 'PROT'
      GROUP BY t1.ID&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 26 Mar 2018 15:12:08 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2018-03-26T15:12:08Z</dc:date>
    <item>
      <title>Function freq and not proc freq</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Function-freq-and-not-proc-freq/m-p/448661#M112876</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a big table with lots of observations and i want to manipulate/transform my data. Here is my problem:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC SQL;
   CREATE TABLE WORK.Lista AS 
   SELECT t1.Name, 
                  t1.ID, 
                  t1.Description, 
                   /* Calculation Number */
          (case when t1.Description EQ 'PROT' then FREQ(t1.Description)
            end) AS Number
      FROM WORK.TOTAL t1
      GROUP BY t1.ID
      ORDER BY t1.Name ASC;
QUIT;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I do not want to have&amp;nbsp;a report of "proc freq". The idea is make a new query with a new variable(Number) and continue the program.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want count only when Description = 'PROT' and not when is different. It is dificult to find the arguments of function freq. What i have to do is to call freq with a condition inside the function, and not outside(that's happen now). But the new collumn(Number) must appear in all observations, also when observation with t1.Description NE 'PROT' must have the count of all 'PROT'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Aleixo&lt;/P&gt;</description>
      <pubDate>Mon, 26 Mar 2018 15:08:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Function-freq-and-not-proc-freq/m-p/448661#M112876</guid>
      <dc:creator>Aleixo</dc:creator>
      <dc:date>2018-03-26T15:08:13Z</dc:date>
    </item>
    <item>
      <title>Re: Function freq and not proc freq</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Function-freq-and-not-proc-freq/m-p/448662#M112877</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;SELECT t1.Name, t1.ID, 
          count(t1.description) AS Number
      FROM WORK.TOTAL t1 
      where t1.description eq 'PROT'
      GROUP BY t1.ID&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 26 Mar 2018 15:12:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Function-freq-and-not-proc-freq/m-p/448662#M112877</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-03-26T15:12:08Z</dc:date>
    </item>
    <item>
      <title>Re: Function freq and not proc freq</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Function-freq-and-not-proc-freq/m-p/448669#M112881</link>
      <description>&lt;P&gt;why don't you use the function count() instead of freq??&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Mar 2018 15:19:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Function-freq-and-not-proc-freq/m-p/448669#M112881</guid>
      <dc:creator>SASUser_22</dc:creator>
      <dc:date>2018-03-26T15:19:04Z</dc:date>
    </item>
    <item>
      <title>Re: Function freq and not proc freq</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Function-freq-and-not-proc-freq/m-p/448671#M112882</link>
      <description>&lt;P&gt;Very nice. Works very well.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have to use more times the statement 'where' in that location of proc sql&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks a lot&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And thanks other answers xD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Mar 2018 15:21:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Function-freq-and-not-proc-freq/m-p/448671#M112882</guid>
      <dc:creator>Aleixo</dc:creator>
      <dc:date>2018-03-26T15:21:42Z</dc:date>
    </item>
  </channel>
</rss>

