<?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 convert a  year column in sas in SAS Software for Learning Community</title>
    <link>https://communities.sas.com/t5/SAS-Software-for-Learning/How-to-convert-a-year-column-in-sas/m-p/915720#M1706</link>
    <description>You called the variable you read in time but then used the variable as YEAR in the second data step. Otherwise the approach is correct.</description>
    <pubDate>Mon, 12 Feb 2024 22:21:27 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2024-02-12T22:21:27Z</dc:date>
    <item>
      <title>How to convert a  year column in sas</title>
      <link>https://communities.sas.com/t5/SAS-Software-for-Learning/How-to-convert-a-year-column-in-sas/m-p/915681#M1698</link>
      <description>&lt;P&gt;So, I have a column for just years but its showing as a numeric value in sas.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How do I convert it to years in sas studio.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I tried&lt;/P&gt;&lt;P&gt;- I tried the ttransforming the data but I keep running to an error because I dont know the exact Format&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Time.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/93586iF60E38F73510B8E4/image-size/large?v=v2&amp;amp;px=999" role="button" title="Time.png" alt="Time.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Feb 2024 21:02:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Software-for-Learning/How-to-convert-a-year-column-in-sas/m-p/915681#M1698</guid>
      <dc:creator>ephraim_1234</dc:creator>
      <dc:date>2024-02-12T21:02:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert a  year column in sas</title>
      <link>https://communities.sas.com/t5/SAS-Software-for-Learning/How-to-convert-a-year-column-in-sas/m-p/915682#M1699</link>
      <description>Do you want it to be a character column or a SAS date value?&lt;BR /&gt;</description>
      <pubDate>Mon, 12 Feb 2024 21:06:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Software-for-Learning/How-to-convert-a-year-column-in-sas/m-p/915682#M1699</guid>
      <dc:creator>lhartjordan</dc:creator>
      <dc:date>2024-02-12T21:06:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert a  year column in sas</title>
      <link>https://communities.sas.com/t5/SAS-Software-for-Learning/How-to-convert-a-year-column-in-sas/m-p/915683#M1700</link>
      <description>&lt;P&gt;I want it to be a date&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Feb 2024 21:07:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Software-for-Learning/How-to-convert-a-year-column-in-sas/m-p/915683#M1700</guid>
      <dc:creator>ephraim_1234</dc:creator>
      <dc:date>2024-02-12T21:07:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert a  year column in sas</title>
      <link>https://communities.sas.com/t5/SAS-Software-for-Learning/How-to-convert-a-year-column-in-sas/m-p/915688#M1703</link>
      <description>SAS dates require a month/day component as well, so it's not a conversion, more of a calculation at that point. You can create a new variable using the MDY function and provide 1, 1 for the month/day. Then format with YEAR4 to get the same value. I am not sure what value that will add overall though.</description>
      <pubDate>Mon, 12 Feb 2024 21:23:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Software-for-Learning/How-to-convert-a-year-column-in-sas/m-p/915688#M1703</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2024-02-12T21:23:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert a  year column in sas</title>
      <link>https://communities.sas.com/t5/SAS-Software-for-Learning/How-to-convert-a-year-column-in-sas/m-p/915706#M1704</link>
      <description>&lt;P&gt;Alright, thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;can you give me like a sample code idea for it. I will work out the rest...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;data have;&lt;BR /&gt;input Time;&lt;BR /&gt;datalines;&lt;BR /&gt;2011&lt;BR /&gt;2010&lt;BR /&gt;2004&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;/* Create a new variable with January 1st of each year */&lt;BR /&gt;data want;&lt;BR /&gt;set have;&lt;BR /&gt;/*&amp;nbsp; using MDY function with January 1st */&lt;BR /&gt;new_date = mdy(1, 1, year);&amp;nbsp;&lt;BR /&gt;format new_date year4.; /* Format the date to display only the year */&lt;BR /&gt;run;&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;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Tried this, it didnt work...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Feb 2024 21:37:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Software-for-Learning/How-to-convert-a-year-column-in-sas/m-p/915706#M1704</guid>
      <dc:creator>ephraim_1234</dc:creator>
      <dc:date>2024-02-12T21:37:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert a  year column in sas</title>
      <link>https://communities.sas.com/t5/SAS-Software-for-Learning/How-to-convert-a-year-column-in-sas/m-p/915720#M1706</link>
      <description>You called the variable you read in time but then used the variable as YEAR in the second data step. Otherwise the approach is correct.</description>
      <pubDate>Mon, 12 Feb 2024 22:21:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Software-for-Learning/How-to-convert-a-year-column-in-sas/m-p/915720#M1706</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2024-02-12T22:21:27Z</dc:date>
    </item>
  </channel>
</rss>

