<?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 Convert date to character string in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Convert-date-to-character-string/m-p/264139#M51773</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to find a way to convert a date into a like for like character string to I can merge in data using the date as a variable.&lt;/P&gt;&lt;P&gt;For example&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Reference&lt;/TD&gt;&lt;TD&gt;Date&lt;/TD&gt;&lt;TD&gt;date2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;893746&lt;/TD&gt;&lt;TD&gt;31MAR2002:00:00:00.000&lt;/TD&gt;&lt;TD&gt;Mar-02&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Where date2 is the datepart(date) formatted using monyy5.&lt;/P&gt;&lt;P&gt;I would like to make a variable date3 that is a character replica of date2 as I don't want to deal with days in the merge.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone know an easy way to do this?&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
    <pubDate>Fri, 15 Apr 2016 12:03:27 GMT</pubDate>
    <dc:creator>PriyaL</dc:creator>
    <dc:date>2016-04-15T12:03:27Z</dc:date>
    <item>
      <title>Convert date to character string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-date-to-character-string/m-p/264139#M51773</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to find a way to convert a date into a like for like character string to I can merge in data using the date as a variable.&lt;/P&gt;&lt;P&gt;For example&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Reference&lt;/TD&gt;&lt;TD&gt;Date&lt;/TD&gt;&lt;TD&gt;date2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;893746&lt;/TD&gt;&lt;TD&gt;31MAR2002:00:00:00.000&lt;/TD&gt;&lt;TD&gt;Mar-02&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Where date2 is the datepart(date) formatted using monyy5.&lt;/P&gt;&lt;P&gt;I would like to make a variable date3 that is a character replica of date2 as I don't want to deal with days in the merge.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone know an easy way to do this?&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Apr 2016 12:03:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-date-to-character-string/m-p/264139#M51773</guid>
      <dc:creator>PriyaL</dc:creator>
      <dc:date>2016-04-15T12:03:27Z</dc:date>
    </item>
    <item>
      <title>Re: Convert date to character string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-date-to-character-string/m-p/264149#M51774</link>
      <description>&lt;P&gt;A reasonable way:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;length date3 $ 3;&lt;/P&gt;
&lt;P&gt;date3 = put(date2, monyy5.);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Because of the LENGTH statement, there is only room to store the first 3 characters.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Apr 2016 12:22:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-date-to-character-string/m-p/264149#M51774</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2016-04-15T12:22:33Z</dc:date>
    </item>
    <item>
      <title>Re: Convert date to character string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-date-to-character-string/m-p/264161#M51776</link>
      <description>The first 3 characters will only display the month whereas I need the month and year.</description>
      <pubDate>Fri, 15 Apr 2016 13:00:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-date-to-character-string/m-p/264161#M51776</guid>
      <dc:creator>PriyaL</dc:creator>
      <dc:date>2016-04-15T13:00:07Z</dc:date>
    </item>
    <item>
      <title>Re: Convert date to character string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-date-to-character-string/m-p/264168#M51779</link>
      <description>&lt;P&gt;OK, then give DATE3 a length of $5 instead of $3.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Apr 2016 13:40:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-date-to-character-string/m-p/264168#M51779</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2016-04-15T13:40:51Z</dc:date>
    </item>
  </channel>
</rss>

