<?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: Construct appropriate pre-and post- sample in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Construct-appropriate-pre-and-post-sample/m-p/454535#M284199</link>
    <description>&lt;P&gt;same as PG, did PG miss customer in group by?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data original;

input supplier customer year post;

datalines;
1001 8001 2000 1
1001 8001 2001 1
1002 8006 1995 0
1002 8006 1996 0
1002 8006 1997 1
1002 8006 1998 1
1002 8006 1999 1
1003 8008 2005 0
1003 8008 2006 0
1003 8009 2006 0
1003 8009 2007 1
;

run;

 
proc sql;
create table hope as
select * 
from original
group by supplier,customer
having count(distinct post) = 2
order by supplier, year;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 16 Apr 2018 18:33:47 GMT</pubDate>
    <dc:creator>novinosrin</dc:creator>
    <dc:date>2018-04-16T18:33:47Z</dc:date>
    <item>
      <title>Construct appropriate pre-and post- sample</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Construct-appropriate-pre-and-post-sample/m-p/454526#M284197</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to restrict my sample to have quasi-balanced pre-and post- observations..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Data original;&lt;/P&gt;&lt;P&gt;input&amp;nbsp;supplier&amp;nbsp;customer year post;&lt;/P&gt;&lt;P&gt;datalines;&lt;/P&gt;&lt;P&gt;1001 8001 2000 1&lt;/P&gt;&lt;P&gt;1001 8001 2001 1&lt;/P&gt;&lt;P&gt;1002 8006 1995 0&lt;/P&gt;&lt;P&gt;1002 8006 1996 0&lt;/P&gt;&lt;P&gt;1002 8006 1997 1&lt;/P&gt;&lt;P&gt;1002 8006 1998 1&lt;/P&gt;&lt;P&gt;1002 8006 1999 1&lt;/P&gt;&lt;P&gt;1003 8008 2005 0&lt;/P&gt;&lt;P&gt;1003 8008 2006 0&lt;/P&gt;&lt;P&gt;1003 8009 2006 0&lt;/P&gt;&lt;P&gt;1003 8009 2007 1&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to keep observations having both pre-and post- period. That is, I want to exclude observations having only (Post = 0s) or (Post = 1s).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, I want to have like this datasets.. after coding;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Data hope;&lt;/P&gt;&lt;P&gt;input&amp;nbsp;supplier&amp;nbsp;customer&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;year post;&lt;/P&gt;&lt;P&gt;datalines;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1002&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;8006&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;1995 0&lt;/P&gt;&lt;P&gt;1002&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;8006&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;1996 0&lt;/P&gt;&lt;P&gt;1002 8006 1997 1&lt;/P&gt;&lt;P&gt;1002 8006 1998 1&lt;/P&gt;&lt;P&gt;1002 8006 1999 1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1003 8009 2006 0&lt;/P&gt;&lt;P&gt;1003 8009 2007 1&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Apr 2018 18:10:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Construct-appropriate-pre-and-post-sample/m-p/454526#M284197</guid>
      <dc:creator>hkim3677</dc:creator>
      <dc:date>2018-04-16T18:10:44Z</dc:date>
    </item>
    <item>
      <title>Re: Construct appropriate pre-and post- sample</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Construct-appropriate-pre-and-post-sample/m-p/454532#M284198</link>
      <description>&lt;P&gt;select the suppliers with two post values:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
create table hope as
select * 
from original
group by supplier
having count(distinct post) = 2;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 16 Apr 2018 18:27:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Construct-appropriate-pre-and-post-sample/m-p/454532#M284198</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2018-04-16T18:27:20Z</dc:date>
    </item>
    <item>
      <title>Re: Construct appropriate pre-and post- sample</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Construct-appropriate-pre-and-post-sample/m-p/454535#M284199</link>
      <description>&lt;P&gt;same as PG, did PG miss customer in group by?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data original;

input supplier customer year post;

datalines;
1001 8001 2000 1
1001 8001 2001 1
1002 8006 1995 0
1002 8006 1996 0
1002 8006 1997 1
1002 8006 1998 1
1002 8006 1999 1
1003 8008 2005 0
1003 8008 2006 0
1003 8009 2006 0
1003 8009 2007 1
;

run;

 
proc sql;
create table hope as
select * 
from original
group by supplier,customer
having count(distinct post) = 2
order by supplier, year;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 16 Apr 2018 18:33:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Construct-appropriate-pre-and-post-sample/m-p/454535#M284199</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-04-16T18:33:47Z</dc:date>
    </item>
  </channel>
</rss>

