<?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: Why isn't my variable converting to sas date format? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Why-isn-t-my-variable-converting-to-sas-date-format/m-p/307164#M65749</link>
    <description>&lt;P&gt;It may help to show those actual Proc Contents results.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;also if you want the result to LOOK like a date like 10/16/2016 instead of 27123 you need to assign a format:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;format Discharge_doc mmddyy10.;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SAS does not automatically assign an informat just because you use a date informat in an input &lt;STRONG&gt;function&lt;/STRONG&gt; unlike and INPUT statement with a format option.&lt;/P&gt;</description>
    <pubDate>Tue, 25 Oct 2016 15:31:31 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2016-10-25T15:31:31Z</dc:date>
    <item>
      <title>Why isn't my variable converting to sas date format?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-isn-t-my-variable-converting-to-sas-date-format/m-p/307147#M65744</link>
      <description>&lt;P&gt;I have a character variable that I am trying to convert to SAS date format (mmddyy10.)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the code I am using:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data anzio_dados_fa;
	set anzio_dados_fa 

	(rename=(DISCHARGE_DOC=DISCHARGE_DOCNUM));
	DISCHARGE_DOC = input(DISCHARGE_DOCNUM, mmddyy10.);
	drop DISCHARGE_DOCNUM;

run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;However, when I do a proc contents and look at my variable, it seems to have only converted it to a number variable now. When I look at the "format" and "informat" columns after doing a PROC CONTENTS, these columns for my variable are just blank.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How do I convert my variable to a date format? What am I doing wrong in my above code?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance&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;P&gt;&amp;nbsp;&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;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Oct 2016 14:54:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-isn-t-my-variable-converting-to-sas-date-format/m-p/307147#M65744</guid>
      <dc:creator>christinagting0</dc:creator>
      <dc:date>2016-10-25T14:54:44Z</dc:date>
    </item>
    <item>
      <title>Re: Why isn't my variable converting to sas date format?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-isn-t-my-variable-converting-to-sas-date-format/m-p/307164#M65749</link>
      <description>&lt;P&gt;It may help to show those actual Proc Contents results.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;also if you want the result to LOOK like a date like 10/16/2016 instead of 27123 you need to assign a format:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;format Discharge_doc mmddyy10.;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SAS does not automatically assign an informat just because you use a date informat in an input &lt;STRONG&gt;function&lt;/STRONG&gt; unlike and INPUT statement with a format option.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Oct 2016 15:31:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-isn-t-my-variable-converting-to-sas-date-format/m-p/307164#M65749</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-10-25T15:31:31Z</dc:date>
    </item>
  </channel>
</rss>

