<?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: Extracting date, month, year and time from a datetime variable in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Extracting-date-month-year-and-time-from-a-datetime-variable/m-p/536252#M147340</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Something like this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data want;&lt;BR /&gt;set date;&lt;BR /&gt;year = substr(date,length(date)-3);&lt;BR /&gt;run;&lt;/P&gt;</description>
    <pubDate>Sun, 17 Feb 2019 16:15:43 GMT</pubDate>
    <dc:creator>stat_sas</dc:creator>
    <dc:date>2019-02-17T16:15:43Z</dc:date>
    <item>
      <title>Extracting date, month, year and time from a datetime variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Extracting-date-month-year-and-time-from-a-datetime-variable/m-p/536251#M147339</link>
      <description>&lt;P&gt;Dear all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;how to extract the last four word from the variable, and recorded as a year?&lt;/P&gt;&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token procnames"&gt;data&lt;/SPAN&gt; date&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
	&lt;SPAN class="token keyword"&gt;input&lt;/SPAN&gt; date &lt;SPAN class="token punctuation"&gt;$&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;50&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token datalines"&gt;	&lt;SPAN class="token keyword"&gt;datalines&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;SPAN class="token data string"&gt;JAN2009&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;SPAN class="token procnames"&gt;run&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;could you please give me some suggestions?&lt;/P&gt;&lt;P&gt;thanks in advance&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>Sun, 17 Feb 2019 15:52:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Extracting-date-month-year-and-time-from-a-datetime-variable/m-p/536251#M147339</guid>
      <dc:creator>France</dc:creator>
      <dc:date>2019-02-17T15:52:36Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting date, month, year and time from a datetime variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Extracting-date-month-year-and-time-from-a-datetime-variable/m-p/536252#M147340</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Something like this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data want;&lt;BR /&gt;set date;&lt;BR /&gt;year = substr(date,length(date)-3);&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Sun, 17 Feb 2019 16:15:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Extracting-date-month-year-and-time-from-a-datetime-variable/m-p/536252#M147340</guid>
      <dc:creator>stat_sas</dc:creator>
      <dc:date>2019-02-17T16:15:43Z</dc:date>
    </item>
  </channel>
</rss>

