<?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 Proc report - COUNT DISTINCT in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Proc-report-COUNT-DISTINCT/m-p/812570#M320621</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would like to know the equivalent of proc sql count distinct operation.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want to count the number of contrats and the number of people in a dataset but for my purpose i want to do it in a proc report (if possible).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So i have id_contrat and id_person that are non numeric variables and i only managed to calculate the number of contrats corresponding to the number of observations. I don't want to display each id_contrat nor id_person.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I did this so far :&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc report data = a ; 

columns ('Perimeter' var_to_group_by n) ;

define var_to_group_by / group ; 
define n / 'nb_contracts' ;
run ; 

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Thanks&lt;/P&gt;</description>
    <pubDate>Wed, 11 May 2022 09:06:17 GMT</pubDate>
    <dc:creator>elsfy</dc:creator>
    <dc:date>2022-05-11T09:06:17Z</dc:date>
    <item>
      <title>Proc report - COUNT DISTINCT</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-report-COUNT-DISTINCT/m-p/812570#M320621</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would like to know the equivalent of proc sql count distinct operation.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want to count the number of contrats and the number of people in a dataset but for my purpose i want to do it in a proc report (if possible).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So i have id_contrat and id_person that are non numeric variables and i only managed to calculate the number of contrats corresponding to the number of observations. I don't want to display each id_contrat nor id_person.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I did this so far :&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc report data = a ; 

columns ('Perimeter' var_to_group_by n) ;

define var_to_group_by / group ; 
define n / 'nb_contracts' ;
run ; 

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 11 May 2022 09:06:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-report-COUNT-DISTINCT/m-p/812570#M320621</guid>
      <dc:creator>elsfy</dc:creator>
      <dc:date>2022-05-11T09:06:17Z</dc:date>
    </item>
    <item>
      <title>Re: Proc report - COUNT DISTINCT</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-report-COUNT-DISTINCT/m-p/812604#M320635</link>
      <description>&lt;P&gt;Like this?&lt;BR /&gt;See&amp;nbsp;&lt;A href="https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/proc/p0bqogcics9o4xn17yvt2qjbgdpi.htm" target="_self"&gt;REPORT Procedure&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have ;
	do group=1 to 3 ;
		do members=1 to int(ranuni(0)*10) ;
			output ;
		end ;
	end ;
run ;

proc report data=have ;
   column group members ;
   define group/group ;
   define members/analysis n ;

run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 11 May 2022 11:23:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-report-COUNT-DISTINCT/m-p/812604#M320635</guid>
      <dc:creator>AMSAS</dc:creator>
      <dc:date>2022-05-11T11:23:20Z</dc:date>
    </item>
  </channel>
</rss>

