<?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: exclude a group of observations in terms of one observation in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/exclude-a-group-of-observations-in-terms-of-one-observation/m-p/512176#M137914</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC SQL;
   CREATE TABLE want  AS
      SELECT
       *
      FROM
        tryy
      GROUP BY psn_name_cited,docdb_family_id
      Having sum(psn_name_cited = psn_name_citing)=0 /* exclude self_citation */
;
QUIT;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 12 Nov 2018 13:22:12 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2018-11-12T13:22:12Z</dc:date>
    <item>
      <title>exclude a group of observations in terms of one observation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/exclude-a-group-of-observations-in-terms-of-one-observation/m-p/512160#M137909</link>
      <description>&lt;P&gt;Dear all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;how can exclude a group of observations in terms of one observation?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;for example, in following observations,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;psn_name_cited, docdb_family_id, psn_name_citing&amp;nbsp;

&lt;U&gt;apple,1,pear

apple,1,apple&lt;/U&gt;

apple,2,orange&amp;nbsp;

apple,2,banana

apple,2, pear

juice,3, bottle

orange,3,water&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I would like to exclude&amp;nbsp;the&amp;nbsp;following observations&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;apple,1,pear

apple,1,apple&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;by using the following codes,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC SQL;
   CREATE TABLE want  AS
      SELECT
       *
      FROM
        tryy
      GROUP BY psn_name_cited,docdb_family_id
      Having psn_name_cited ne psn_name_citing /* exclude self_citation */
;
QUIT;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, only&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;apple,1,apple&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;been excluded from the sample.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Could you please give me some suggestions about this?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks in advance.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Nov 2018 12:07:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/exclude-a-group-of-observations-in-terms-of-one-observation/m-p/512160#M137909</guid>
      <dc:creator>France</dc:creator>
      <dc:date>2018-11-12T12:07:52Z</dc:date>
    </item>
    <item>
      <title>Re: exclude a group of observations in terms of one observation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/exclude-a-group-of-observations-in-terms-of-one-observation/m-p/512163#M137910</link>
      <description>&lt;P&gt;Maybe joining psn_name_citing back on by psn_name_citing=psn_name, something like:&lt;/P&gt;
&lt;PRE&gt;proc sql;
  create table want as
  select a.*
  from   have a
  left join have b
  on      a.psn_name=b.psn_name_citating
  where b.psn_name_citing="";
quit;&lt;/PRE&gt;
&lt;P&gt;Not tested, post test data in the form of a datastep in future.&lt;/P&gt;</description>
      <pubDate>Mon, 12 Nov 2018 12:21:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/exclude-a-group-of-observations-in-terms-of-one-observation/m-p/512163#M137910</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-11-12T12:21:11Z</dc:date>
    </item>
    <item>
      <title>Re: exclude a group of observations in terms of one observation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/exclude-a-group-of-observations-in-terms-of-one-observation/m-p/512176#M137914</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC SQL;
   CREATE TABLE want  AS
      SELECT
       *
      FROM
        tryy
      GROUP BY psn_name_cited,docdb_family_id
      Having sum(psn_name_cited = psn_name_citing)=0 /* exclude self_citation */
;
QUIT;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 12 Nov 2018 13:22:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/exclude-a-group-of-observations-in-terms-of-one-observation/m-p/512176#M137914</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2018-11-12T13:22:12Z</dc:date>
    </item>
  </channel>
</rss>

