<?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: Put (to_char) function in SAS PROC SQL showing YYYY/MM format from datetime in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Put-to-char-function-in-SAS-PROC-SQL-showing-YYYY-MM-format-from/m-p/620097#M182161</link>
    <description>Other approaches you might consider:&lt;BR /&gt;  Without changing the internal value, assign it SAS Format DTdate9.&lt;BR /&gt;Instead of this standard format (as I don't think DTyymms format exists), you can create your own format with your preferred date layout using the Format Procedure)&lt;BR /&gt;</description>
    <pubDate>Sun, 26 Jan 2020 22:29:33 GMT</pubDate>
    <dc:creator>Peter_C</dc:creator>
    <dc:date>2020-01-26T22:29:33Z</dc:date>
    <item>
      <title>Put (to_char) function in SAS PROC SQL showing YYYY/MM format from datetime</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Put-to-char-function-in-SAS-PROC-SQL-showing-YYYY-MM-format-from/m-p/620076#M182147</link>
      <description>&lt;P&gt;Hi.&lt;/P&gt;&lt;P&gt;I have a column with datetime values like this:&amp;nbsp;&lt;STRONG&gt;01.01.20 09:28:35,000000&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;And I want to change them into this format (YYYY/MM):&amp;nbsp;&lt;STRONG&gt;2020/01&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;In Oracle SQL I used&amp;nbsp;function &lt;U&gt;to_char(column_name,'YYYY/MM')&lt;/U&gt; but I wasn't able to do the same thing in SAS PROC SQL.&lt;/P&gt;&lt;P&gt;I tried things like &lt;U&gt;put(column_name,yyyySmm7.)&lt;/U&gt; but it either doesn't work or date values are out of range or it shows weird numbers...&lt;/P&gt;&lt;P&gt;Can anybody help me with this?&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Sun, 26 Jan 2020 17:10:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Put-to-char-function-in-SAS-PROC-SQL-showing-YYYY-MM-format-from/m-p/620076#M182147</guid>
      <dc:creator>MartinJurca</dc:creator>
      <dc:date>2020-01-26T17:10:54Z</dc:date>
    </item>
    <item>
      <title>Re: Put (to_char) function in SAS PROC SQL showing YYYY/MM format from datetime</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Put-to-char-function-in-SAS-PROC-SQL-showing-YYYY-MM-format-from/m-p/620078#M182149</link>
      <description>&lt;P&gt;Sounds like you need:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;put(datepart(column_name), yymms7.) as yyyysmm&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 26 Jan 2020 17:44:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Put-to-char-function-in-SAS-PROC-SQL-showing-YYYY-MM-format-from/m-p/620078#M182149</guid>
      <dc:creator>unison</dc:creator>
      <dc:date>2020-01-26T17:44:25Z</dc:date>
    </item>
    <item>
      <title>Re: Put (to_char) function in SAS PROC SQL showing YYYY/MM format from datetime</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Put-to-char-function-in-SAS-PROC-SQL-showing-YYYY-MM-format-from/m-p/620080#M182151</link>
      <description>Thanks, it is working!</description>
      <pubDate>Sun, 26 Jan 2020 17:53:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Put-to-char-function-in-SAS-PROC-SQL-showing-YYYY-MM-format-from/m-p/620080#M182151</guid>
      <dc:creator>MartinJurca</dc:creator>
      <dc:date>2020-01-26T17:53:56Z</dc:date>
    </item>
    <item>
      <title>Re: Put (to_char) function in SAS PROC SQL showing YYYY/MM format from datetime</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Put-to-char-function-in-SAS-PROC-SQL-showing-YYYY-MM-format-from/m-p/620097#M182161</link>
      <description>Other approaches you might consider:&lt;BR /&gt;  Without changing the internal value, assign it SAS Format DTdate9.&lt;BR /&gt;Instead of this standard format (as I don't think DTyymms format exists), you can create your own format with your preferred date layout using the Format Procedure)&lt;BR /&gt;</description>
      <pubDate>Sun, 26 Jan 2020 22:29:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Put-to-char-function-in-SAS-PROC-SQL-showing-YYYY-MM-format-from/m-p/620097#M182161</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2020-01-26T22:29:33Z</dc:date>
    </item>
  </channel>
</rss>

