<?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 data step and Year function in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/data-step-and-Year-function/m-p/89477#M18979</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Everyone&lt;/P&gt;&lt;P&gt;Whenever I create a data step and use the Year function as it is used below, it never adds the new variable and I don't get an error. I can add it after the fact in another data step, but not in one.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a syntax issue or just can't be done?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Paul&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data s0First (keep=cnty_name County place start stop exit filing_cat1 agecat4);&lt;/P&gt;&lt;P&gt;set workep;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if ep1=1 and year(start) in (2006, 2007, 2008, 2009, 2010, 2011) &lt;/P&gt;&lt;P&gt;and filing_cat1 in ("FNN", "FNA", "FVL");&lt;/P&gt;&lt;P&gt;County=cnty_name;&lt;/P&gt;&lt;P&gt;Year=year(start);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if spellage in (0, 1, 2, 3) then agecat4 = 1;&lt;/P&gt;&lt;P&gt;if spellage in (4, 5, 6) then agecat4 = 2;&lt;/P&gt;&lt;P&gt;if spellage in (7, 8, 9) then agecat4 = 3;&lt;/P&gt;&lt;P&gt;if spellage in (10, 11, 12) then agecat4 = 4;&lt;/P&gt;&lt;P&gt;if spellage in (13, 14, 15) then agecat4 = 5;&lt;/P&gt;&lt;P&gt;if spellage in (16, 17) then agecat4 = 6;&lt;/P&gt;&lt;P&gt;if spellage &amp;gt; 17 or spellage eq . or spellage &amp;lt; 0 then agecat4 = 7;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 29 Jan 2013 15:21:14 GMT</pubDate>
    <dc:creator>Paul_NYS</dc:creator>
    <dc:date>2013-01-29T15:21:14Z</dc:date>
    <item>
      <title>data step and Year function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/data-step-and-Year-function/m-p/89477#M18979</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Everyone&lt;/P&gt;&lt;P&gt;Whenever I create a data step and use the Year function as it is used below, it never adds the new variable and I don't get an error. I can add it after the fact in another data step, but not in one.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a syntax issue or just can't be done?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Paul&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data s0First (keep=cnty_name County place start stop exit filing_cat1 agecat4);&lt;/P&gt;&lt;P&gt;set workep;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if ep1=1 and year(start) in (2006, 2007, 2008, 2009, 2010, 2011) &lt;/P&gt;&lt;P&gt;and filing_cat1 in ("FNN", "FNA", "FVL");&lt;/P&gt;&lt;P&gt;County=cnty_name;&lt;/P&gt;&lt;P&gt;Year=year(start);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if spellage in (0, 1, 2, 3) then agecat4 = 1;&lt;/P&gt;&lt;P&gt;if spellage in (4, 5, 6) then agecat4 = 2;&lt;/P&gt;&lt;P&gt;if spellage in (7, 8, 9) then agecat4 = 3;&lt;/P&gt;&lt;P&gt;if spellage in (10, 11, 12) then agecat4 = 4;&lt;/P&gt;&lt;P&gt;if spellage in (13, 14, 15) then agecat4 = 5;&lt;/P&gt;&lt;P&gt;if spellage in (16, 17) then agecat4 = 6;&lt;/P&gt;&lt;P&gt;if spellage &amp;gt; 17 or spellage eq . or spellage &amp;lt; 0 then agecat4 = 7;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Jan 2013 15:21:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/data-step-and-Year-function/m-p/89477#M18979</guid>
      <dc:creator>Paul_NYS</dc:creator>
      <dc:date>2013-01-29T15:21:14Z</dc:date>
    </item>
    <item>
      <title>Re: data step and Year function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/data-step-and-Year-function/m-p/89478#M18980</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You use a keep statement to the data set you create and Year is not in the list.&lt;/P&gt;&lt;P&gt;data s0First (keep=cnty_name County place start stop exit filing_cat1 agecat4&amp;nbsp; &lt;STRONG&gt;YEAR&lt;/STRONG&gt;);&lt;/P&gt;&lt;P&gt;&lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Jan 2013 15:23:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/data-step-and-Year-function/m-p/89478#M18980</guid>
      <dc:creator>AncaTilea</dc:creator>
      <dc:date>2013-01-29T15:23:04Z</dc:date>
    </item>
    <item>
      <title>Re: data step and Year function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/data-step-and-Year-function/m-p/89479#M18981</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Anca. It is usually something like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Paul&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Jan 2013 16:14:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/data-step-and-Year-function/m-p/89479#M18981</guid>
      <dc:creator>Paul_NYS</dc:creator>
      <dc:date>2013-01-29T16:14:11Z</dc:date>
    </item>
  </channel>
</rss>

