<?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 do I drop rows with dates I do not want - based on month and day? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-drop-rows-with-dates-I-do-not-want-based-on-month-and/m-p/727491#M226284</link>
    <description>&lt;P&gt;Is your date variable numeric with a format like mmddyy8?&lt;/P&gt;
&lt;P&gt;If so then you can get the Month from the date with the Month function, which returns the number of the month, and the Day function returns the number of the day in a month.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data want;
   set have;
   if month(datevar)=12 and day(datevar)=31;
run;&lt;/PRE&gt;
&lt;P&gt;If used this way, without a "then" subsets the data by keeping the values the condition is true for.&lt;/P&gt;
&lt;P&gt;From what you showed I am not sure what the name of your variable is because "data date" is not a standard SAS variable name.&lt;/P&gt;</description>
    <pubDate>Thu, 18 Mar 2021 17:38:02 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2021-03-18T17:38:02Z</dc:date>
    <item>
      <title>How do I drop rows with dates I do not want - based on month and day?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-drop-rows-with-dates-I-do-not-want-based-on-month-and/m-p/727488#M226281</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to drop rows of data that do not have 12/31 as their month and day. Does anyone know how to do this?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example:&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Historical CRSP PERMNO Link to COMPUSTAT Record&lt;/TD&gt;&lt;TD&gt;Data Date&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;54594&lt;/TD&gt;&lt;TD&gt;5/31/18&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;54594&lt;/TD&gt;&lt;TD&gt;5/31/19&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;54594&lt;/TD&gt;&lt;TD&gt;5/31/20&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;21020&lt;/TD&gt;&lt;TD&gt;12/31/18&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;21020&lt;/TD&gt;&lt;TD&gt;12/31/19&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;21020&lt;/TD&gt;&lt;TD&gt;12/31/20&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;11499&lt;/TD&gt;&lt;TD&gt;12/31/18&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DROP ALL DATES THAT ARE NOT 12/31.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Mar 2021 17:31:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-drop-rows-with-dates-I-do-not-want-based-on-month-and/m-p/727488#M226281</guid>
      <dc:creator>jap6198</dc:creator>
      <dc:date>2021-03-18T17:31:11Z</dc:date>
    </item>
    <item>
      <title>Re: How do I drop rows with dates I do not want - based on month and day?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-drop-rows-with-dates-I-do-not-want-based-on-month-and/m-p/727490#M226283</link>
      <description>if month(data_date)=12 and day(data_date)=31;&lt;BR /&gt;</description>
      <pubDate>Thu, 18 Mar 2021 17:37:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-drop-rows-with-dates-I-do-not-want-based-on-month-and/m-p/727490#M226283</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-03-18T17:37:47Z</dc:date>
    </item>
    <item>
      <title>Re: How do I drop rows with dates I do not want - based on month and day?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-drop-rows-with-dates-I-do-not-want-based-on-month-and/m-p/727491#M226284</link>
      <description>&lt;P&gt;Is your date variable numeric with a format like mmddyy8?&lt;/P&gt;
&lt;P&gt;If so then you can get the Month from the date with the Month function, which returns the number of the month, and the Day function returns the number of the day in a month.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data want;
   set have;
   if month(datevar)=12 and day(datevar)=31;
run;&lt;/PRE&gt;
&lt;P&gt;If used this way, without a "then" subsets the data by keeping the values the condition is true for.&lt;/P&gt;
&lt;P&gt;From what you showed I am not sure what the name of your variable is because "data date" is not a standard SAS variable name.&lt;/P&gt;</description>
      <pubDate>Thu, 18 Mar 2021 17:38:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-drop-rows-with-dates-I-do-not-want-based-on-month-and/m-p/727491#M226284</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-03-18T17:38:02Z</dc:date>
    </item>
    <item>
      <title>Re: How do I drop rows with dates I do not want - based on month and day?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-drop-rows-with-dates-I-do-not-want-based-on-month-and/m-p/727516#M226300</link>
      <description>Thank you!</description>
      <pubDate>Thu, 18 Mar 2021 18:45:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-drop-rows-with-dates-I-do-not-want-based-on-month-and/m-p/727516#M226300</guid>
      <dc:creator>jap6198</dc:creator>
      <dc:date>2021-03-18T18:45:26Z</dc:date>
    </item>
  </channel>
</rss>

