<?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: How to exclude a specific year? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-exclude-a-specific-year/m-p/575038#M162579</link>
    <description>&lt;P&gt;Thank you so much, PaigeMiller!&lt;/P&gt;</description>
    <pubDate>Fri, 19 Jul 2019 19:26:31 GMT</pubDate>
    <dc:creator>ybz12003</dc:creator>
    <dc:date>2019-07-19T19:26:31Z</dc:date>
    <item>
      <title>How to exclude a specific year?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-exclude-a-specific-year/m-p/573164#M161773</link>
      <description>&lt;P&gt;Hello:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would like to exclude the year 2009 in the variable 'DOB'.&amp;nbsp;&amp;nbsp; DOB is the format of ''mmddyy10.''&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;
&lt;P&gt;Please advice how to approach it.&amp;nbsp; Thanks.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jul 2019 16:58:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-exclude-a-specific-year/m-p/573164#M161773</guid>
      <dc:creator>ybz12003</dc:creator>
      <dc:date>2019-07-12T16:58:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to exclude a specific year?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-exclude-a-specific-year/m-p/573166#M161774</link>
      <description>You use YEAR() to get the YEAR() from a data component and then use the standard ne or eq or comparison desired. This assumes your variable is type=numeric and format is mmddyy10. If the type is character this does not apply.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 12 Jul 2019 17:01:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-exclude-a-specific-year/m-p/573166#M161774</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-07-12T17:01:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to exclude a specific year?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-exclude-a-specific-year/m-p/573168#M161775</link>
      <description>&lt;P&gt;So, it should be&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt; data want; set have; DOB ne year'2009'; run;

&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 12 Jul 2019 17:19:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-exclude-a-specific-year/m-p/573168#M161775</guid>
      <dc:creator>ybz12003</dc:creator>
      <dc:date>2019-07-12T17:19:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to exclude a specific year?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-exclude-a-specific-year/m-p/573170#M161776</link>
      <description>No, but I'm assuming you tried that and it didn't work already with errors in the log. &lt;BR /&gt;&lt;BR /&gt;YEAR() is function, the parameter would be a date variable that would return the date and then you would check if that value is not 2009.</description>
      <pubDate>Fri, 12 Jul 2019 17:22:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-exclude-a-specific-year/m-p/573170#M161776</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-07-12T17:22:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to exclude a specific year?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-exclude-a-specific-year/m-p/573171#M161777</link>
      <description>I'm going to assume you're just having a bad day, because this is pretty basic and you should be able to do this IMO, from what you post on here. &lt;BR /&gt;This would remove all records where the year of the date of birth is 2009.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;if year(dob) ne 2009;&lt;BR /&gt;</description>
      <pubDate>Fri, 12 Jul 2019 17:23:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-exclude-a-specific-year/m-p/573171#M161777</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-07-12T17:23:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to exclude a specific year?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-exclude-a-specific-year/m-p/573172#M161778</link>
      <description>&lt;P&gt;The YEAR() function uses parenthesis, and there are no quotes around numbers, and of course the rest of your SAS code has to be correct syntax as well.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want; 
set have;
if year(DOB) ne 2009; 
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;But there's no real need to create a separate data set to do any analysis&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc means data=have(where=(year(dob) ne 2009));
...
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jul 2019 17:28:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-exclude-a-specific-year/m-p/573172#M161778</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-07-12T17:28:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to exclude a specific year?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-exclude-a-specific-year/m-p/573276#M161817</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data dsn;
input dob;
cards;
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
;
run;
data want; 
set dsn;
if dob eq 2009 then delete  ; 
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 13 Jul 2019 08:56:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-exclude-a-specific-year/m-p/573276#M161817</guid>
      <dc:creator>BrahmanandaRao</dc:creator>
      <dc:date>2019-07-13T08:56:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to exclude a specific year?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-exclude-a-specific-year/m-p/573282#M161822</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/265860"&gt;@BrahmanandaRao&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data dsn;
input dob;
cards;
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
;
run;
data want; 
set dsn;
if dob eq 2009 then delete  ; 
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Or even shorter&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
input dob;
if dob ne 2009 then output;
cards;
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 13 Jul 2019 11:03:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-exclude-a-specific-year/m-p/573282#M161822</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-07-13T11:03:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to exclude a specific year?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-exclude-a-specific-year/m-p/575038#M162579</link>
      <description>&lt;P&gt;Thank you so much, PaigeMiller!&lt;/P&gt;</description>
      <pubDate>Fri, 19 Jul 2019 19:26:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-exclude-a-specific-year/m-p/575038#M162579</guid>
      <dc:creator>ybz12003</dc:creator>
      <dc:date>2019-07-19T19:26:31Z</dc:date>
    </item>
  </channel>
</rss>

