<?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 How to convert a formatted SAS Date variable to a character variable? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-a-formatted-SAS-Date-variable-to-a-character/m-p/812402#M320543</link>
    <description>&lt;P&gt;I have date variables that are formatted dd/mm/yyyy.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is it possible to character variables where the values are equal to dd/mm/yyyy?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(Context: I am trying to run a proc report and the date values are not showing up correctly (missing out the "/"s and each part is on a separate line. I'm hoping that by using character variables it might resolve this issue).&lt;/P&gt;</description>
    <pubDate>Tue, 10 May 2022 13:55:16 GMT</pubDate>
    <dc:creator>EC27556</dc:creator>
    <dc:date>2022-05-10T13:55:16Z</dc:date>
    <item>
      <title>How to convert a formatted SAS Date variable to a character variable?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-a-formatted-SAS-Date-variable-to-a-character/m-p/812402#M320543</link>
      <description>&lt;P&gt;I have date variables that are formatted dd/mm/yyyy.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is it possible to character variables where the values are equal to dd/mm/yyyy?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(Context: I am trying to run a proc report and the date values are not showing up correctly (missing out the "/"s and each part is on a separate line. I'm hoping that by using character variables it might resolve this issue).&lt;/P&gt;</description>
      <pubDate>Tue, 10 May 2022 13:55:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-convert-a-formatted-SAS-Date-variable-to-a-character/m-p/812402#M320543</guid>
      <dc:creator>EC27556</dc:creator>
      <dc:date>2022-05-10T13:55:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert a formatted SAS Date variable to a character variable?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-a-formatted-SAS-Date-variable-to-a-character/m-p/812407#M320545</link>
      <description>&lt;P&gt;If you are running a report (via PROC REPORT or PROC TABULATE), you DO NOT need character strings.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In PROC REPORT, you can use the option&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc report split='~';&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and now the / character is not interpreted as a line-break.&lt;/P&gt;</description>
      <pubDate>Tue, 10 May 2022 14:37:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-convert-a-formatted-SAS-Date-variable-to-a-character/m-p/812407#M320545</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-05-10T14:37:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert a formatted SAS Date variable to a character variable?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-a-formatted-SAS-Date-variable-to-a-character/m-p/812409#M320547</link>
      <description>Wow, legend, thank you!</description>
      <pubDate>Tue, 10 May 2022 14:40:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-convert-a-formatted-SAS-Date-variable-to-a-character/m-p/812409#M320547</guid>
      <dc:creator>EC27556</dc:creator>
      <dc:date>2022-05-10T14:40:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert a formatted SAS Date variable to a character variable?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-a-formatted-SAS-Date-variable-to-a-character/m-p/812413#M320549</link>
      <description>&lt;P&gt;Can you provide some sample code.&amp;nbsp;&amp;nbsp;&lt;BR /&gt;I just attempted the following and my dates aren't being split&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have ;
	format date ddmmyy6. ;
	do date=today() to today()+3 ;
		dateC=putn(date,"DDMMYY10.") ;
		output ;
	end ;
run ;

proc report split='/';
	column date datec ;
run ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Output:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;DIV class="branch"&gt;
&lt;DIV&gt;
&lt;DIV align="center"&gt;
&lt;TABLE class="table" summary="Procedure Report: Detailed and/or summarized report" frame="box" rules="all" cellspacing="0" cellpadding="5"&gt;&lt;COLGROUP&gt; &lt;COL /&gt; &lt;COL /&gt;&lt;/COLGROUP&gt;
&lt;THEAD&gt;
&lt;TR&gt;
&lt;TH class="c header" scope="col"&gt;date&lt;/TH&gt;
&lt;TH class="c header" scope="col"&gt;dateC&lt;/TH&gt;
&lt;/TR&gt;
&lt;/THEAD&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD class="r data"&gt;100522&lt;/TD&gt;
&lt;TD class="l data"&gt;10/05/2022&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="r data"&gt;110522&lt;/TD&gt;
&lt;TD class="l data"&gt;11/05/2022&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="r data"&gt;120522&lt;/TD&gt;
&lt;TD class="l data"&gt;12/05/2022&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="r data"&gt;130522&lt;/TD&gt;
&lt;TD class="l data"&gt;13/05/2022&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 May 2022 14:49:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-convert-a-formatted-SAS-Date-variable-to-a-character/m-p/812413#M320549</guid>
      <dc:creator>AMSAS</dc:creator>
      <dc:date>2022-05-10T14:49:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert a formatted SAS Date variable to a character variable?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-a-formatted-SAS-Date-variable-to-a-character/m-p/812417#M320551</link>
      <description>&lt;P&gt;I think the issue (I'm speculating) is that dates as column headers have the problem. Dates in the rest of the table shouldn't have the problem.&lt;/P&gt;</description>
      <pubDate>Tue, 10 May 2022 14:53:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-convert-a-formatted-SAS-Date-variable-to-a-character/m-p/812417#M320551</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-05-10T14:53:45Z</dc:date>
    </item>
  </channel>
</rss>

