<?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 Date issue in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Date-issue/m-p/132142#M26939</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have an issue with one of the datasets I am working on. The two date fields in my dataset are as below -&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" cellpadding="0" cellspacing="0" style="border: #4f493b 1pt solid;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD nowrap="nowrap" style="background: #e8e6da; border: #4f493b 1pt solid; padding: 0.75pt;" valign="top"&gt;&lt;P align="right" style="text-align: right;"&gt;&lt;STRONG style="font-size: 10pt; font-family: 'Arial','sans-serif';"&gt;48&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="background: white; border: #4f493b 1pt solid; padding: 0.75pt;" valign="top"&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; font-size: 10pt;"&gt;ELGBGNDT&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="background: white; border: #4f493b 1pt solid; padding: 0.75pt;" valign="top"&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; font-size: 10pt;"&gt;Num&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="background: white; border: #4f493b 1pt solid; padding: 0.75pt;" valign="top"&gt;&lt;P align="right" style="text-align: right;"&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; font-size: 10pt;"&gt;8&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="background: white; border: #4f493b 1pt solid; padding: 0.75pt;" valign="top"&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; font-size: 10pt;"&gt;MMDDYY10.&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="background: white; border: #4f493b 1pt solid; padding: 0.75pt;" valign="top"&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="background: white; border: #4f493b 1pt solid; padding: 0.75pt;" valign="top"&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD nowrap="nowrap" style="background: #e8e6da; border: #4f493b 1pt solid; padding: 0.75pt;" valign="top"&gt;&lt;P align="right" style="text-align: right;"&gt;&lt;STRONG style="font-size: 10pt; font-family: 'Arial','sans-serif';"&gt;34&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="background: white; border: #4f493b 1pt solid; padding: 0.75pt;" valign="top"&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; font-size: 10pt;"&gt;ELIGDT&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="background: white; border: #4f493b 1pt solid; padding: 0.75pt;" valign="top"&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; font-size: 10pt;"&gt;Num&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="background: white; border: #4f493b 1pt solid; padding: 0.75pt;" valign="top"&gt;&lt;P align="right" style="text-align: right;"&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; font-size: 10pt;"&gt;8&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="background: white; border: #4f493b 1pt solid; padding: 0.75pt;" valign="top"&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; font-size: 10pt;"&gt;MMDDYY10.&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="background: white; border: #4f493b 1pt solid; padding: 0.75pt;" valign="top"&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; font-size: 10pt;"&gt;DATE9.&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="background: white; border: #4f493b 1pt solid; padding: 0.75pt;" valign="top"&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; font-size: 10pt;"&gt;ELIGDT&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I run this code, I get back 0 records which I am not able to resolve.&lt;/P&gt;&lt;P&gt;data MHTST.MKTLVL_MBR_201112;&lt;/P&gt;&lt;P&gt;set MHTST.FINALMBR;&lt;/P&gt;&lt;P&gt;if eligdt='12/31/2011' then output;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;These are the values for the two variables in the sas dataset.&lt;/P&gt;&lt;P&gt;ELIGDT&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ELGBGNDT&lt;/P&gt;&lt;TABLE cellspacing="0" class="Table"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;07/31/2011&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;07/01/2011&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;08/31/2011&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;08/01/2011&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;09/30/2011&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;09/01/2011&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;10/31/2011&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;10/01/2011&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;11/30/2011&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;11/01/2011&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;12/31/2011&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;12/01/2011&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any suggestions are appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;BR /&gt;saspert&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 11 Mar 2013 15:45:16 GMT</pubDate>
    <dc:creator>saspert</dc:creator>
    <dc:date>2013-03-11T15:45:16Z</dc:date>
    <item>
      <title>Date issue</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-issue/m-p/132142#M26939</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have an issue with one of the datasets I am working on. The two date fields in my dataset are as below -&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" cellpadding="0" cellspacing="0" style="border: #4f493b 1pt solid;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD nowrap="nowrap" style="background: #e8e6da; border: #4f493b 1pt solid; padding: 0.75pt;" valign="top"&gt;&lt;P align="right" style="text-align: right;"&gt;&lt;STRONG style="font-size: 10pt; font-family: 'Arial','sans-serif';"&gt;48&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="background: white; border: #4f493b 1pt solid; padding: 0.75pt;" valign="top"&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; font-size: 10pt;"&gt;ELGBGNDT&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="background: white; border: #4f493b 1pt solid; padding: 0.75pt;" valign="top"&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; font-size: 10pt;"&gt;Num&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="background: white; border: #4f493b 1pt solid; padding: 0.75pt;" valign="top"&gt;&lt;P align="right" style="text-align: right;"&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; font-size: 10pt;"&gt;8&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="background: white; border: #4f493b 1pt solid; padding: 0.75pt;" valign="top"&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; font-size: 10pt;"&gt;MMDDYY10.&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="background: white; border: #4f493b 1pt solid; padding: 0.75pt;" valign="top"&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="background: white; border: #4f493b 1pt solid; padding: 0.75pt;" valign="top"&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD nowrap="nowrap" style="background: #e8e6da; border: #4f493b 1pt solid; padding: 0.75pt;" valign="top"&gt;&lt;P align="right" style="text-align: right;"&gt;&lt;STRONG style="font-size: 10pt; font-family: 'Arial','sans-serif';"&gt;34&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="background: white; border: #4f493b 1pt solid; padding: 0.75pt;" valign="top"&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; font-size: 10pt;"&gt;ELIGDT&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="background: white; border: #4f493b 1pt solid; padding: 0.75pt;" valign="top"&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; font-size: 10pt;"&gt;Num&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="background: white; border: #4f493b 1pt solid; padding: 0.75pt;" valign="top"&gt;&lt;P align="right" style="text-align: right;"&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; font-size: 10pt;"&gt;8&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="background: white; border: #4f493b 1pt solid; padding: 0.75pt;" valign="top"&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; font-size: 10pt;"&gt;MMDDYY10.&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="background: white; border: #4f493b 1pt solid; padding: 0.75pt;" valign="top"&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; font-size: 10pt;"&gt;DATE9.&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="background: white; border: #4f493b 1pt solid; padding: 0.75pt;" valign="top"&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; font-size: 10pt;"&gt;ELIGDT&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I run this code, I get back 0 records which I am not able to resolve.&lt;/P&gt;&lt;P&gt;data MHTST.MKTLVL_MBR_201112;&lt;/P&gt;&lt;P&gt;set MHTST.FINALMBR;&lt;/P&gt;&lt;P&gt;if eligdt='12/31/2011' then output;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;These are the values for the two variables in the sas dataset.&lt;/P&gt;&lt;P&gt;ELIGDT&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ELGBGNDT&lt;/P&gt;&lt;TABLE cellspacing="0" class="Table"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;07/31/2011&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;07/01/2011&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;08/31/2011&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;08/01/2011&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;09/30/2011&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;09/01/2011&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;10/31/2011&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;10/01/2011&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;11/30/2011&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;11/01/2011&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;12/31/2011&lt;/TD&gt;&lt;TD class="Data" nowrap="nowrap" style="text-align: right;"&gt;12/01/2011&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any suggestions are appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;BR /&gt;saspert&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Mar 2013 15:45:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-issue/m-p/132142#M26939</guid>
      <dc:creator>saspert</dc:creator>
      <dc:date>2013-03-11T15:45:16Z</dc:date>
    </item>
    <item>
      <title>Re: Date issue</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-issue/m-p/132143#M26940</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;add a d onto your if statement and stating the date in date9. format.&amp;nbsp; i.e.,&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;if eligdt='31dec2011'd then output;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Note: corrected suggestion after seeing the suggestion made by &lt;A __default_attr="669173" __jive_macro_name="user" class="jive_macro jive_macro_user" data-objecttype="3" href="https://communities.sas.com/"&gt;&lt;/A&gt;.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Mar 2013 15:47:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-issue/m-p/132143#M26940</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2013-03-11T15:47:42Z</dc:date>
    </item>
    <item>
      <title>Re: Date issue</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-issue/m-p/132144#M26941</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi saspert,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please look at the below code and it will serve your purpose.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data a;&lt;/P&gt;&lt;P&gt;input date1 : mmddyy10. date2 : mmddyy10.;&lt;/P&gt;&lt;P&gt;format date1 date2 date9.;&lt;/P&gt;&lt;P&gt;datalines;&lt;/P&gt;&lt;P&gt;07/31/2011 07/01/2011&lt;/P&gt;&lt;P&gt;12/31/2011 12/01/2011&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data b;&lt;/P&gt;&lt;P&gt;set a;&lt;/P&gt;&lt;P&gt;if date1='31dec2011'd then output;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // adding a 'd' is possible only with date9. date format and not with mmddyy date format.&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note - In the above example i am reading&amp;nbsp; the nonstandard date value , sas stores date values in numeric format, then i am using format statement to convert the date value into a comparable format.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let me know in case of any queries.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Ankit&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Mar 2013 16:32:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-issue/m-p/132144#M26941</guid>
      <dc:creator>Ankitsas</dc:creator>
      <dc:date>2013-03-11T16:32:33Z</dc:date>
    </item>
  </channel>
</rss>

