<?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: Character to Date format in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Character-to-Date-format/m-p/51699#M14189</link>
    <description>I think what you want is &lt;BR /&gt;
&lt;BR /&gt;
newdate=INPUT(&amp;amp;date, yymmdd8.);&lt;BR /&gt;
&lt;BR /&gt;
(Assuming yout %LET is actually&lt;BR /&gt;
&lt;BR /&gt;
%LET date = 20090723;&lt;BR /&gt;
)</description>
    <pubDate>Tue, 07 Jul 2009 01:56:26 GMT</pubDate>
    <dc:creator>Doc_Duke</dc:creator>
    <dc:date>2009-07-07T01:56:26Z</dc:date>
    <item>
      <title>Character to Date format</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Character-to-Date-format/m-p/51698#M14188</link>
      <description>Hi All,&lt;BR /&gt;
I've assigned below macro.&lt;BR /&gt;
%let date = 20090723(yymmddn8.)&lt;BR /&gt;
but the question is the i want to change it in to Date ormat.&lt;BR /&gt;
using this macro i need another variable "newdate" is in any type of Date format. like date9., mmddyy...........&lt;BR /&gt;
&lt;BR /&gt;
Thanks in Advance&lt;BR /&gt;
Alankar</description>
      <pubDate>Tue, 07 Jul 2009 01:52:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Character-to-Date-format/m-p/51698#M14188</guid>
      <dc:creator>Alankar</dc:creator>
      <dc:date>2009-07-07T01:52:12Z</dc:date>
    </item>
    <item>
      <title>Re: Character to Date format</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Character-to-Date-format/m-p/51699#M14189</link>
      <description>I think what you want is &lt;BR /&gt;
&lt;BR /&gt;
newdate=INPUT(&amp;amp;date, yymmdd8.);&lt;BR /&gt;
&lt;BR /&gt;
(Assuming yout %LET is actually&lt;BR /&gt;
&lt;BR /&gt;
%LET date = 20090723;&lt;BR /&gt;
)</description>
      <pubDate>Tue, 07 Jul 2009 01:56:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Character-to-Date-format/m-p/51699#M14189</guid>
      <dc:creator>Doc_Duke</dc:creator>
      <dc:date>2009-07-07T01:56:26Z</dc:date>
    </item>
    <item>
      <title>Re: Character to Date format</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Character-to-Date-format/m-p/51700#M14190</link>
      <description>I assume you are asking how to set a &lt;B&gt;dataset variable&lt;/B&gt; from the value of a &lt;B&gt;macro variable&lt;/B&gt;.  In this case you could use the INPUT function.&lt;BR /&gt;
&lt;BR /&gt;
 newdate=input("&amp;amp;date",mmddyy.);&lt;BR /&gt;
&lt;BR /&gt;
If you want to control how this new numeric variable is displayed then you can attach a format to it.&lt;BR /&gt;
&lt;BR /&gt;
If you want to store the value into a character variable then you could use the PUT function.&lt;BR /&gt;
&lt;BR /&gt;
 newdatef = put(newdate,date9.);</description>
      <pubDate>Tue, 07 Jul 2009 08:06:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Character-to-Date-format/m-p/51700#M14190</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-07-07T08:06:56Z</dc:date>
    </item>
    <item>
      <title>Re: Character to Date format</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Character-to-Date-format/m-p/51701#M14191</link>
      <description>Your final use of this data-string is unclear - so does the data need to be a SAS date variable with an internal representation (days since Jan 1, 1960) or are you expecting a formatted value (1/1/2009)?  &lt;BR /&gt;
&lt;BR /&gt;
Regardless, if you want to use SAS macro language only, you will need to look into using %SYSFUNC and at least the INPUT function to convert the character-representation to a SAS DATE value, and then if you also want to re-format the string to display a formatted DATE, you will again use %SYSFUNC and the PUTN function with the appropriate SAS format.&lt;BR /&gt;
&lt;BR /&gt;
Suggest searching the SAS support  &lt;A href="http://support.sas.com/" target="_blank"&gt;http://support.sas.com/&lt;/A&gt;  website using keywords from the information provided in this post reply -- you will find both SAS-hosted documentation and also supplemental technical/conference papers on this topic.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
      <pubDate>Tue, 07 Jul 2009 12:40:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Character-to-Date-format/m-p/51701#M14191</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2009-07-07T12:40:57Z</dc:date>
    </item>
  </channel>
</rss>

