<?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 to create a new column with only &amp;quot;year&amp;quot; from the column contains MM/DD/YYYY? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-new-column-with-only-quot-year-quot-from-the/m-p/770293#M244370</link>
    <description>&lt;P&gt;If these are NUMERIC date values then this should work&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
     set have;
     year=year(date);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If these are CHARACTER date values&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
     set have;
     date=input(date,mmddyy10.);
     year=year(date);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 24 Sep 2021 16:33:50 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2021-09-24T16:33:50Z</dc:date>
    <item>
      <title>How to create a new column with only "year" from the column contains MM/DD/YYYY?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-new-column-with-only-quot-year-quot-from-the/m-p/770283#M244365</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a column contains date information (MM/DD/YYYY) as below. How do I create a new column that only contains the "year" from this column? For example, the first row of the new column is 2015, and&amp;nbsp; the next two rows are 2018.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Date&lt;/P&gt;
&lt;TABLE width="111"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="111"&gt;08/18/2015&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;01/15/2018&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;10/01/2018&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you all in advance!&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Sep 2021 16:04:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-new-column-with-only-quot-year-quot-from-the/m-p/770283#M244365</guid>
      <dc:creator>Denali</dc:creator>
      <dc:date>2021-09-24T16:04:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a new column with only "year" from the column contains MM/DD/YYYY?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-new-column-with-only-quot-year-quot-from-the/m-p/770293#M244370</link>
      <description>&lt;P&gt;If these are NUMERIC date values then this should work&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
     set have;
     year=year(date);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If these are CHARACTER date values&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
     set have;
     date=input(date,mmddyy10.);
     year=year(date);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 24 Sep 2021 16:33:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-new-column-with-only-quot-year-quot-from-the/m-p/770293#M244370</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-09-24T16:33:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a new column with only "year" from the column contains MM/DD/YYYY?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-new-column-with-only-quot-year-quot-from-the/m-p/770311#M244379</link>
      <description>&lt;P&gt;What will you use that Year value for?&lt;/P&gt;
&lt;P&gt;In many cases if the value is an actual SAS date value you would just assign the Year. format for many things.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Sep 2021 17:26:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-new-column-with-only-quot-year-quot-from-the/m-p/770311#M244379</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-09-24T17:26:05Z</dc:date>
    </item>
  </channel>
</rss>

