<?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 how can i count number of character value in proc report in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/how-can-i-count-number-of-character-value-in-proc-report/m-p/283267#M59246</link>
    <description>&lt;P&gt;HI,&lt;/P&gt;&lt;P&gt;I want to count number of bulls by farm and by year.&lt;/P&gt;&lt;P&gt;my data is :&lt;/P&gt;&lt;P&gt;farm &amp;nbsp; &amp;nbsp; &amp;nbsp; year &amp;nbsp; &amp;nbsp; &amp;nbsp;bulls&lt;/P&gt;&lt;P&gt;A &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2012 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;x&lt;/P&gt;&lt;P&gt;A &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;SPAN&gt;2013 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;y&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;A &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;SPAN&gt;2014 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;x&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;B &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;SPAN&gt; 2015 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; k&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;B &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;SPAN&gt;&amp;nbsp; 2013 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;n&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I used proc report :&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;proc report data=work.H nowd;&lt;BR /&gt;columns Farm year bulls;&lt;BR /&gt;define Farm/ group;&lt;BR /&gt;define year/ group;&lt;BR /&gt;define bulls / analysis n&amp;nbsp;&lt;/SPAN&gt;"Number of bulls";&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;but it dosen't run because the var 'bulls' is not a numeric var.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;thx&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 11 Jul 2016 10:44:49 GMT</pubDate>
    <dc:creator>ESSALAHBENNANI</dc:creator>
    <dc:date>2016-07-11T10:44:49Z</dc:date>
    <item>
      <title>how can i count number of character value in proc report</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/how-can-i-count-number-of-character-value-in-proc-report/m-p/283267#M59246</link>
      <description>&lt;P&gt;HI,&lt;/P&gt;&lt;P&gt;I want to count number of bulls by farm and by year.&lt;/P&gt;&lt;P&gt;my data is :&lt;/P&gt;&lt;P&gt;farm &amp;nbsp; &amp;nbsp; &amp;nbsp; year &amp;nbsp; &amp;nbsp; &amp;nbsp;bulls&lt;/P&gt;&lt;P&gt;A &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2012 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;x&lt;/P&gt;&lt;P&gt;A &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;SPAN&gt;2013 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;y&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;A &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;SPAN&gt;2014 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;x&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;B &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;SPAN&gt; 2015 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; k&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;B &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;SPAN&gt;&amp;nbsp; 2013 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;n&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I used proc report :&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;proc report data=work.H nowd;&lt;BR /&gt;columns Farm year bulls;&lt;BR /&gt;define Farm/ group;&lt;BR /&gt;define year/ group;&lt;BR /&gt;define bulls / analysis n&amp;nbsp;&lt;/SPAN&gt;"Number of bulls";&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;but it dosen't run because the var 'bulls' is not a numeric var.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;thx&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jul 2016 10:44:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/how-can-i-count-number-of-character-value-in-proc-report/m-p/283267#M59246</guid>
      <dc:creator>ESSALAHBENNANI</dc:creator>
      <dc:date>2016-07-11T10:44:49Z</dc:date>
    </item>
    <item>
      <title>Re: how can i count number of character value in proc report</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/how-can-i-count-number-of-character-value-in-proc-report/m-p/283272#M59247</link>
      <description>&lt;P&gt;HI,&lt;/P&gt;&lt;P&gt;I think with proc sql is more easy :&lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt;create table nbr_F as&lt;BR /&gt;select Ferme, Annee_IA, count(num_national) as nbr_F&lt;BR /&gt;from Lait_plu.H&lt;BR /&gt;group by Ferme, Annee_IA;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jul 2016 11:20:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/how-can-i-count-number-of-character-value-in-proc-report/m-p/283272#M59247</guid>
      <dc:creator>ESSALAHBENNANI</dc:creator>
      <dc:date>2016-07-11T11:20:02Z</dc:date>
    </item>
    <item>
      <title>Re: how can i count number of character value in proc report</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/how-can-i-count-number-of-character-value-in-proc-report/m-p/283273#M59248</link>
      <description>&lt;P&gt;Can you show what your expected output would look like. Much like proc report I also have no straigtforward idea of how to add / count that character variable " bulls". One thing I can imagine is that you would like a count of distinct values of bulls. But that would be guessing.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards, Jan.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jul 2016 11:26:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/how-can-i-count-number-of-character-value-in-proc-report/m-p/283273#M59248</guid>
      <dc:creator>jklaverstijn</dc:creator>
      <dc:date>2016-07-11T11:26:31Z</dc:date>
    </item>
    <item>
      <title>Re: how can i count number of character value in proc report</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/how-can-i-count-number-of-character-value-in-proc-report/m-p/283277#M59250</link>
      <description>&lt;P&gt;Is converting 'bulls' to numeric in a DATA Step first an option for you?&lt;/P&gt;
&lt;P&gt;SAS Sample for the INPUT and PUT functions. &lt;A href="http://support.sas.com/kb/24/590.html" target="_blank"&gt;http://support.sas.com/kb/24/590.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jul 2016 11:51:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/how-can-i-count-number-of-character-value-in-proc-report/m-p/283277#M59250</guid>
      <dc:creator>Mark2010</dc:creator>
      <dc:date>2016-07-11T11:51:35Z</dc:date>
    </item>
    <item>
      <title>Re: how can i count number of character value in proc report</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/how-can-i-count-number-of-character-value-in-proc-report/m-p/283282#M59252</link>
      <description>&lt;P&gt;You can also use proc tabulate if you want to customize your report, and as you've posted Proc SQL is an option.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jul 2016 12:04:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/how-can-i-count-number-of-character-value-in-proc-report/m-p/283282#M59252</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-07-11T12:04:42Z</dc:date>
    </item>
    <item>
      <title>Re: how can i count number of character value in proc report</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/how-can-i-count-number-of-character-value-in-proc-report/m-p/283283#M59253</link>
      <description>Farm year nbr_bulls&lt;BR /&gt;A 2012 2739&lt;BR /&gt;A 2013 3799&lt;BR /&gt;A 2014 3678&lt;BR /&gt;A 2015 1968&lt;BR /&gt;B 2012 481&lt;BR /&gt;B 2013 1176&lt;BR /&gt;B 2014 1192&lt;BR /&gt;B 2015 1212&lt;BR /&gt;C 2012 193&lt;BR /&gt;C 2013 522&lt;BR /&gt;C 2014 454&lt;BR /&gt;C 2015 449&lt;BR /&gt;D 2012 404&lt;BR /&gt;D 2013 430&lt;BR /&gt;D 2014 426&lt;BR /&gt;D 2015 416&lt;BR /&gt;E 2012 822&lt;BR /&gt;E 2013 831&lt;BR /&gt;E 2014 856&lt;BR /&gt;E 2015 1008&lt;BR /&gt;&lt;BR /&gt;Yes I want a count of distinct values.&lt;BR /&gt;thx&lt;BR /&gt;</description>
      <pubDate>Mon, 11 Jul 2016 12:12:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/how-can-i-count-number-of-character-value-in-proc-report/m-p/283283#M59253</guid>
      <dc:creator>ESSALAHBENNANI</dc:creator>
      <dc:date>2016-07-11T12:12:03Z</dc:date>
    </item>
    <item>
      <title>Re: how can i count number of character value in proc report</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/how-can-i-count-number-of-character-value-in-proc-report/m-p/283284#M59254</link>
      <description>no I don't think so&lt;BR /&gt;thx</description>
      <pubDate>Mon, 11 Jul 2016 12:12:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/how-can-i-count-number-of-character-value-in-proc-report/m-p/283284#M59254</guid>
      <dc:creator>ESSALAHBENNANI</dc:creator>
      <dc:date>2016-07-11T12:12:40Z</dc:date>
    </item>
    <item>
      <title>Re: how can i count number of character value in proc report</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/how-can-i-count-number-of-character-value-in-proc-report/m-p/283292#M59255</link>
      <description>&lt;P&gt;Distinct counts can be easily obtained with SQL. You could code a CREATE TABLE and use that table in PROC REPORT for presentation purposes.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data h;
   input farm $ year bulls $;
   cards;
A 2012 x
A 2012 p
A 2013 y
B 2013 x
B 2014 k
B 2015 n
;
proc sql;
   select farm, year, count(distinct bulls) as nbr_bulls
   from h
   group by farm, year;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 11 Jul 2016 13:09:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/how-can-i-count-number-of-character-value-in-proc-report/m-p/283292#M59255</guid>
      <dc:creator>jklaverstijn</dc:creator>
      <dc:date>2016-07-11T13:09:13Z</dc:date>
    </item>
    <item>
      <title>Re: how can i count number of character value in proc report</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/how-can-i-count-number-of-character-value-in-proc-report/m-p/283521#M59257</link>
      <description>thx you verry much</description>
      <pubDate>Mon, 11 Jul 2016 15:32:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/how-can-i-count-number-of-character-value-in-proc-report/m-p/283521#M59257</guid>
      <dc:creator>ESSALAHBENNANI</dc:creator>
      <dc:date>2016-07-11T15:32:17Z</dc:date>
    </item>
  </channel>
</rss>

