<?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: calculate the year from dd-mm-yyyy in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/calculate-the-year-from-dd-mm-yyyy/m-p/769725#M244091</link>
    <description>&lt;P&gt;it is a character variable, in my table the dates show up as DDMMYYYY, for example, my received_date for the submissions show up as 10APR2018 18APR2018 24APR2018 and instead of each one showing up individually, I want to calculate the year for it just tell me that in 2018 I had __ number of submissions&lt;/P&gt;</description>
    <pubDate>Wed, 22 Sep 2021 21:25:18 GMT</pubDate>
    <dc:creator>celbel</dc:creator>
    <dc:date>2021-09-22T21:25:18Z</dc:date>
    <item>
      <title>calculate the year from dd-mm-yyyy</title>
      <link>https://communities.sas.com/t5/SAS-Programming/calculate-the-year-from-dd-mm-yyyy/m-p/769721#M244087</link>
      <description>&lt;P&gt;Hi, I want to use proc freq in order to create a table that shows me submissions created during a specific time period.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The dates I have are listed as dd-mm-yyyy and I'm looking to calculate the year for the table to tell me how many submissions I have for the year, for example the time period runs from 2018-2021 so I want the table to tell me how many submissions I have for 2018, 2019, 2021 individually instead of it showing me every single submission on its own.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any idea on how to calculate the year?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Sep 2021 21:18:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/calculate-the-year-from-dd-mm-yyyy/m-p/769721#M244087</guid>
      <dc:creator>celbel</dc:creator>
      <dc:date>2021-09-22T21:18:31Z</dc:date>
    </item>
    <item>
      <title>Re: calculate the year from dd-mm-yyyy</title>
      <link>https://communities.sas.com/t5/SAS-Programming/calculate-the-year-from-dd-mm-yyyy/m-p/769723#M244089</link>
      <description>Is your date a SAS date, numeric with a dd-mm-yy format? Or is it a character variable?&lt;BR /&gt;&lt;BR /&gt;If it's a SAS date, format the variable using YEAR4 in the PROC FREQ, proc means example below:&lt;BR /&gt;&lt;A href="https://gist.github.com/statgeek/0cae5568752959b035516d6ac07a20fb" target="_blank"&gt;https://gist.github.com/statgeek/0cae5568752959b035516d6ac07a20fb&lt;/A&gt;</description>
      <pubDate>Wed, 22 Sep 2021 21:20:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/calculate-the-year-from-dd-mm-yyyy/m-p/769723#M244089</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-09-22T21:20:55Z</dc:date>
    </item>
    <item>
      <title>Re: calculate the year from dd-mm-yyyy</title>
      <link>https://communities.sas.com/t5/SAS-Programming/calculate-the-year-from-dd-mm-yyyy/m-p/769725#M244091</link>
      <description>&lt;P&gt;it is a character variable, in my table the dates show up as DDMMYYYY, for example, my received_date for the submissions show up as 10APR2018 18APR2018 24APR2018 and instead of each one showing up individually, I want to calculate the year for it just tell me that in 2018 I had __ number of submissions&lt;/P&gt;</description>
      <pubDate>Wed, 22 Sep 2021 21:25:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/calculate-the-year-from-dd-mm-yyyy/m-p/769725#M244091</guid>
      <dc:creator>celbel</dc:creator>
      <dc:date>2021-09-22T21:25:18Z</dc:date>
    </item>
    <item>
      <title>Re: calculate the year from dd-mm-yyyy</title>
      <link>https://communities.sas.com/t5/SAS-Programming/calculate-the-year-from-dd-mm-yyyy/m-p/769733#M244093</link>
      <description>&lt;P&gt;Advice: always use numeric SAS date values, not character strings. There are so many SAS functions and formats and other features that work properly with numeric SAS date values, that will make your life easier, there's really no reason to not use them.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data intermediate;
    set have;
    date_numeric=input(date,date9.); /* Convert character date to numeric date */
run;
proc freq data=intermediate;
    tables date_numeric/out=want;
    format date_numeric year4.;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 22 Sep 2021 21:57:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/calculate-the-year-from-dd-mm-yyyy/m-p/769733#M244093</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-09-22T21:57:17Z</dc:date>
    </item>
    <item>
      <title>Re: calculate the year from dd-mm-yyyy</title>
      <link>https://communities.sas.com/t5/SAS-Programming/calculate-the-year-from-dd-mm-yyyy/m-p/769734#M244094</link>
      <description>&lt;P&gt;that worked, thank you!&lt;/P&gt;</description>
      <pubDate>Wed, 22 Sep 2021 21:42:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/calculate-the-year-from-dd-mm-yyyy/m-p/769734#M244094</guid>
      <dc:creator>celbel</dc:creator>
      <dc:date>2021-09-22T21:42:04Z</dc:date>
    </item>
    <item>
      <title>Re: calculate the year from dd-mm-yyyy</title>
      <link>https://communities.sas.com/t5/SAS-Programming/calculate-the-year-from-dd-mm-yyyy/m-p/769789#M244114</link>
      <description>&lt;P&gt;Did you run PROC CONTENTS or inspect the variable attributes by right-clicking on it in the table viewer?&lt;/P&gt;
&lt;P&gt;You say it is formatted as DDMMYYYY, but then you show dates in the SAS-typical DDMM&lt;FONT color="#FF0000"&gt;M&lt;/FONT&gt;YYYY format.&lt;/P&gt;
&lt;P&gt;Please confirm the type and display format of the variable before we proceed.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Sep 2021 04:38:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/calculate-the-year-from-dd-mm-yyyy/m-p/769789#M244114</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-09-23T04:38:35Z</dc:date>
    </item>
  </channel>
</rss>

