<?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: Extract year from a date in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Extract-year-from-a-date/m-p/423962#M104325</link>
    <description>&lt;PRE&gt;proc sql noprint;
  select year(max(date)),year(min(date))
    into :max_year, :min_year
      from projet.p
  ;
quit;
&lt;/PRE&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 28 Dec 2017 21:20:24 GMT</pubDate>
    <dc:creator>art297</dc:creator>
    <dc:date>2017-12-28T21:20:24Z</dc:date>
    <item>
      <title>Extract year from a date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Extract-year-from-a-date/m-p/423958#M104321</link>
      <description>&lt;P&gt;Hello!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to extract the year of a date but i can't find of to do it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I use proc sql to have the max et min date but i do not know how to get only the year and store them into macro variable&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
select max(date) as maxdate, min(date) as mindate
from projet.p;
quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;%let maxdate = ..&lt;/P&gt;&lt;P&gt;%let mindate= ...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you help me please?&lt;/P&gt;</description>
      <pubDate>Thu, 28 Dec 2017 20:28:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Extract-year-from-a-date/m-p/423958#M104321</guid>
      <dc:creator>prehendere</dc:creator>
      <dc:date>2017-12-28T20:28:19Z</dc:date>
    </item>
    <item>
      <title>Re: Extract year from a date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Extract-year-from-a-date/m-p/423959#M104322</link>
      <description>&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token procnames"&gt;proc&lt;/SPAN&gt; &lt;SPAN class="token procnames"&gt;sql&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token statement"&gt;select&lt;/SPAN&gt; year&lt;SPAN class="token punctuation"&gt;(max(&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;date&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;))&lt;/SPAN&gt; into :macro_year&lt;BR /&gt;&lt;SPAN class="token keyword"&gt; from&lt;/SPAN&gt; projet&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;p&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token procnames"&gt;quit&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;BR /&gt;&lt;BR /&gt;%put &amp;amp;macro_year;&lt;BR /&gt;&lt;BR /&gt;%let year=&amp;amp;macro_year;&lt;BR /&gt;&lt;BR /&gt;%put &amp;amp;year;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 28 Dec 2017 20:42:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Extract-year-from-a-date/m-p/423959#M104322</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2017-12-28T20:42:17Z</dc:date>
    </item>
    <item>
      <title>Re: Extract year from a date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Extract-year-from-a-date/m-p/423962#M104325</link>
      <description>&lt;PRE&gt;proc sql noprint;
  select year(max(date)),year(min(date))
    into :max_year, :min_year
      from projet.p
  ;
quit;
&lt;/PRE&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Dec 2017 21:20:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Extract-year-from-a-date/m-p/423962#M104325</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2017-12-28T21:20:24Z</dc:date>
    </item>
    <item>
      <title>Re: Extract year from a date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Extract-year-from-a-date/m-p/423972#M104334</link>
      <description>&lt;P&gt;thank you!&lt;/P&gt;</description>
      <pubDate>Thu, 28 Dec 2017 22:14:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Extract-year-from-a-date/m-p/423972#M104334</guid>
      <dc:creator>prehendere</dc:creator>
      <dc:date>2017-12-28T22:14:41Z</dc:date>
    </item>
  </channel>
</rss>

