<?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: to convert a date from date9 format to sas number in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/to-convert-a-date-from-date9-format-to-sas-number/m-p/228303#M41230</link>
    <description>&lt;P&gt;So if the variable is of type NUM and has a format DATE9 applied and the values when printed look like valid dates, such as '12SEP2015' then it already IS and number. In fact if the value is '12SEP2015'd then the number in the XDATE variable is 20,343.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There is nothing to "convert".&lt;/P&gt;</description>
    <pubDate>Sat, 03 Oct 2015 01:26:06 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2015-10-03T01:26:06Z</dc:date>
    <item>
      <title>to convert a date from date9 format to sas number</title>
      <link>https://communities.sas.com/t5/SAS-Programming/to-convert-a-date-from-date9-format-to-sas-number/m-p/228297#M41226</link>
      <description>&lt;P&gt;to convert a date &amp;nbsp;variable - xdate &amp;nbsp;to SAS date values like 20340 . Xdate has values -12SEP2015 and xdate is of numeric and format date9&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;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Oct 2015 23:34:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/to-convert-a-date-from-date9-format-to-sas-number/m-p/228297#M41226</guid>
      <dc:creator>archana</dc:creator>
      <dc:date>2015-10-02T23:34:46Z</dc:date>
    </item>
    <item>
      <title>Re: to convert a date from date9 format to sas number</title>
      <link>https://communities.sas.com/t5/SAS-Programming/to-convert-a-date-from-date9-format-to-sas-number/m-p/228302#M41229</link>
      <description>&lt;P&gt;data have;&lt;BR /&gt;date_have='12SEP2015'd;&lt;BR /&gt;format date_have date9.;&lt;BR /&gt;date_want=date_have;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc print data=have;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Sat, 03 Oct 2015 00:23:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/to-convert-a-date-from-date9-format-to-sas-number/m-p/228302#M41229</guid>
      <dc:creator>stat_sas</dc:creator>
      <dc:date>2015-10-03T00:23:37Z</dc:date>
    </item>
    <item>
      <title>Re: to convert a date from date9 format to sas number</title>
      <link>https://communities.sas.com/t5/SAS-Programming/to-convert-a-date-from-date9-format-to-sas-number/m-p/228303#M41230</link>
      <description>&lt;P&gt;So if the variable is of type NUM and has a format DATE9 applied and the values when printed look like valid dates, such as '12SEP2015' then it already IS and number. In fact if the value is '12SEP2015'd then the number in the XDATE variable is 20,343.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There is nothing to "convert".&lt;/P&gt;</description>
      <pubDate>Sat, 03 Oct 2015 01:26:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/to-convert-a-date-from-date9-format-to-sas-number/m-p/228303#M41230</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2015-10-03T01:26:06Z</dc:date>
    </item>
    <item>
      <title>Re: to convert a date from date9 format to sas number</title>
      <link>https://communities.sas.com/t5/SAS-Programming/to-convert-a-date-from-date9-format-to-sas-number/m-p/228314#M41233</link>
      <description>&lt;P&gt;Tom,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;The vales in Xdata re of 12SEP2015, 01OCT2015. &amp;nbsp;when i try to assign it to new variable ydate i need to get the number but i am getting empty values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; ydate = datepart(xdate); - didnt work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;tried others too.&lt;/P&gt;</description>
      <pubDate>Sat, 03 Oct 2015 11:27:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/to-convert-a-date-from-date9-format-to-sas-number/m-p/228314#M41233</guid>
      <dc:creator>archana</dc:creator>
      <dc:date>2015-10-03T11:27:47Z</dc:date>
    </item>
    <item>
      <title>Re: to convert a date from date9 format to sas number</title>
      <link>https://communities.sas.com/t5/SAS-Programming/to-convert-a-date-from-date9-format-to-sas-number/m-p/228315#M41234</link>
      <description>&lt;P&gt;The DATEPART() function converts a DATETIME value (number of seconds) to a DATE value (number of days). So basically you divided your date by 86,400 (24hr*60min/hr*60sec/min)&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ydate = xdate ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 03 Oct 2015 11:52:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/to-convert-a-date-from-date9-format-to-sas-number/m-p/228315#M41234</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2015-10-03T11:52:22Z</dc:date>
    </item>
    <item>
      <title>Re: to convert a date from date9 format to sas number</title>
      <link>https://communities.sas.com/t5/SAS-Programming/to-convert-a-date-from-date9-format-to-sas-number/m-p/228316#M41235</link>
      <description>&lt;P&gt;How can i add d to my date value.&lt;/P&gt;</description>
      <pubDate>Sat, 03 Oct 2015 11:51:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/to-convert-a-date-from-date9-format-to-sas-number/m-p/228316#M41235</guid>
      <dc:creator>archana</dc:creator>
      <dc:date>2015-10-03T11:51:58Z</dc:date>
    </item>
    <item>
      <title>Re: to convert a date from date9 format to sas number</title>
      <link>https://communities.sas.com/t5/SAS-Programming/to-convert-a-date-from-date9-format-to-sas-number/m-p/228318#M41237</link>
      <description>&lt;P&gt;If D is an integer number of days then just add it.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;newdate = olddate + d ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If you want to add other intervals (months, weeks) then you should look at the INTNX() function.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;newdate = intnx('day',olddate,d);
newdate = intnx('month',olddate,m,'same');
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 03 Oct 2015 12:00:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/to-convert-a-date-from-date9-format-to-sas-number/m-p/228318#M41237</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2015-10-03T12:00:54Z</dc:date>
    </item>
  </channel>
</rss>

