<?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 add a year column in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-To-add-a-year-column/m-p/578461#M164075</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data a;
    set a;
    year=2016;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The reason your original code didn't work is that "2016"d is not valid, when you enclose a text string in quotes and append a D after the last quote, this indicates to SAS that the value enclosed in the quotes is a text date in the format of 01JAN16. and then SAS will convert it to a valid SAS date. But your code had "2016"d which is not a date in the proper format.&lt;/P&gt;</description>
    <pubDate>Thu, 01 Aug 2019 15:21:31 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2019-08-01T15:21:31Z</dc:date>
    <item>
      <title>How To add a year column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-To-add-a-year-column/m-p/578455#M164072</link>
      <description>&lt;P&gt;Hello Everyone , i'm trying to add a year column with the value 2016 for each observation , this is what i tried but it didn't work.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any Suggestion Would be Much Appreciated , thank you.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data DB_16; 
   set DB_16;
   format Year Year4.;
   Year = '2016'd;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Aug 2019 15:10:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-To-add-a-year-column/m-p/578455#M164072</guid>
      <dc:creator>Midi</dc:creator>
      <dc:date>2019-08-01T15:10:01Z</dc:date>
    </item>
    <item>
      <title>Re: How To add a year column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-To-add-a-year-column/m-p/578457#M164073</link>
      <description>&lt;P&gt;Try&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data DB_16; 
   set DB_16;
retain Year 2016;
  
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 01 Aug 2019 15:15:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-To-add-a-year-column/m-p/578457#M164073</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-08-01T15:15:11Z</dc:date>
    </item>
    <item>
      <title>Re: How To add a year column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-To-add-a-year-column/m-p/578460#M164074</link>
      <description>&lt;P&gt;Thank you , but that didn't work&amp;nbsp; !!!&lt;/P&gt;</description>
      <pubDate>Thu, 01 Aug 2019 15:17:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-To-add-a-year-column/m-p/578460#M164074</guid>
      <dc:creator>Midi</dc:creator>
      <dc:date>2019-08-01T15:17:57Z</dc:date>
    </item>
    <item>
      <title>Re: How To add a year column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-To-add-a-year-column/m-p/578461#M164075</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data a;
    set a;
    year=2016;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The reason your original code didn't work is that "2016"d is not valid, when you enclose a text string in quotes and append a D after the last quote, this indicates to SAS that the value enclosed in the quotes is a text date in the format of 01JAN16. and then SAS will convert it to a valid SAS date. But your code had "2016"d which is not a date in the proper format.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Aug 2019 15:21:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-To-add-a-year-column/m-p/578461#M164075</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-08-01T15:21:31Z</dc:date>
    </item>
    <item>
      <title>Re: How To add a year column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-To-add-a-year-column/m-p/578463#M164077</link>
      <description>&lt;P&gt;Why don't you try to just create a var with 2016 ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data DB_16 ;
set DB_16 ;
year = 2016 ;
run ;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;It will put 2016 on each observation&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token punctuation"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Aug 2019 15:21:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-To-add-a-year-column/m-p/578463#M164077</guid>
      <dc:creator>Onizuka</dc:creator>
      <dc:date>2019-08-01T15:21:34Z</dc:date>
    </item>
    <item>
      <title>Re: How To add a year column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-To-add-a-year-column/m-p/578465#M164078</link>
      <description>&lt;P&gt;Please post the log&lt;/P&gt;</description>
      <pubDate>Thu, 01 Aug 2019 15:21:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-To-add-a-year-column/m-p/578465#M164078</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-08-01T15:21:12Z</dc:date>
    </item>
  </channel>
</rss>

