<?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: Converting a SAS date to a formatted Date in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Converting-a-SAS-date-to-a-formatted-Date/m-p/380036#M91405</link>
    <description>&lt;P&gt;Do you want it to be a SAS date variable with the proper format? Then do:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;newdate = date;
format newdate mmddyy10.;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Or do you want it to be the string representation? Then do:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;newdate = put(date,yymmdd10.);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;which creates a character variable.&lt;/P&gt;</description>
    <pubDate>Thu, 27 Jul 2017 13:34:32 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2017-07-27T13:34:32Z</dc:date>
    <item>
      <title>Converting a SAS date to a formatted Date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Converting-a-SAS-date-to-a-formatted-Date/m-p/380010#M91404</link>
      <description>&lt;P&gt;For some reason I can not figure this out. I have a variable, 'date' that is a numeric variable and has SAS value dates. For example:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;date=19632&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Which refers to the date of 10/1/2013. &amp;nbsp;I want create a new variable 'newdate' that has the mmddyy10. format.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How do I convert date to newdate?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Lorena&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jul 2017 13:32:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Converting-a-SAS-date-to-a-formatted-Date/m-p/380010#M91404</guid>
      <dc:creator>LOLO</dc:creator>
      <dc:date>2017-07-27T13:32:02Z</dc:date>
    </item>
    <item>
      <title>Re: Converting a SAS date to a formatted Date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Converting-a-SAS-date-to-a-formatted-Date/m-p/380036#M91405</link>
      <description>&lt;P&gt;Do you want it to be a SAS date variable with the proper format? Then do:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;newdate = date;
format newdate mmddyy10.;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Or do you want it to be the string representation? Then do:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;newdate = put(date,yymmdd10.);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;which creates a character variable.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jul 2017 13:34:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Converting-a-SAS-date-to-a-formatted-Date/m-p/380036#M91405</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-07-27T13:34:32Z</dc:date>
    </item>
    <item>
      <title>Re: Converting a SAS date to a formatted Date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Converting-a-SAS-date-to-a-formatted-Date/m-p/381757#M91430</link>
      <description>&lt;P&gt;The flexibility of SAS date formats is one of the, IMHO, great features. Plus you have the ability to create custom ones as well.&lt;/P&gt;
&lt;P&gt;The format controls the appearance for display and in analysis procedures can also be used to assign bins for grouping.&lt;/P&gt;
&lt;P&gt;Except for some odd uses I recommend leaving date values as numeric as long as possible and just assign the format as desired for any specific use. Formats may be permanently assigned to the variable at creation but overridden with a format statement in any procedure.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data _null_;
   date=19632;
   put 'Date in date9. format=' date date9.;
   put 'Date in mmddyy10. format=' date mmddyy10.;
   put 'Date in worddate. format=' date worddate.;
   put 'Date in Julian  format=' date Julian.;
   put 'Date in year quarter format=' date YYQs.;
run;&lt;/PRE&gt;</description>
      <pubDate>Thu, 27 Jul 2017 16:08:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Converting-a-SAS-date-to-a-formatted-Date/m-p/381757#M91430</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-07-27T16:08:26Z</dc:date>
    </item>
  </channel>
</rss>

