<?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: How to convert 8w. format to mmddyyw. format? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-datew-format-to-mmddyyw-format/m-p/672657#M202172</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/329937"&gt;@takpdpb7&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;For example: I have the original DOB as '01JAN2020'. I would like to convert it to '01/01/2020'&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Do you have a character variable or a numeric variable? (SAS only has &lt;STRONG&gt;two&lt;/STRONG&gt; types.)&lt;/P&gt;
&lt;P&gt;If you have a numeric variable change the format attached to have it displayed in the different way.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;format dob mmddyy10.;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If you have a character variable then convert it to a date value first.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;dob = put( input(dob,date9.) , mmddyy10.);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Note:&lt;/STRONG&gt; I assumed that the first 01 is the MONTH.&amp;nbsp; Others might assume it is DAY.&amp;nbsp; That is why you should use either DATE9. or YYMMDD10. format instead of MMDDYY10. or DDMMYY10. to avoid that confusion.&lt;/P&gt;</description>
    <pubDate>Mon, 27 Jul 2020 18:34:55 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2020-07-27T18:34:55Z</dc:date>
    <item>
      <title>How to convert datew. format to mmddyyw. format?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-datew-format-to-mmddyyw-format/m-p/672650#M202167</link>
      <description>&lt;P&gt;For example: I have the original DOB as '01JAN2020'. I would like to convert it to '01/01/2020'&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jul 2020 18:32:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-convert-datew-format-to-mmddyyw-format/m-p/672650#M202167</guid>
      <dc:creator>takpdpb7</dc:creator>
      <dc:date>2020-07-27T18:32:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert 8w. format to mmddyyw. format?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-datew-format-to-mmddyyw-format/m-p/672655#M202170</link>
      <description>&lt;P&gt;Do you mean you have a character variable DOB which appears as&amp;nbsp;&lt;SPAN&gt;01JAN2020?&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;num_date=input(dob,date9.);
format num_date ddmmyys10.;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Or do you mean you have a numeric variable that displays as&amp;nbsp;01JAN2020?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;format dob ddmmyys10.;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jul 2020 18:35:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-convert-datew-format-to-mmddyyw-format/m-p/672655#M202170</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-07-27T18:35:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert 8w. format to mmddyyw. format?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-datew-format-to-mmddyyw-format/m-p/672656#M202171</link>
      <description>&lt;P&gt;It seems that your DOB is already a SAS date variable, with a DATE9. format. If that is the case, just change the format to MMDDYY10. or DDMMYY10. (depending on which order you want displayed).&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jul 2020 18:32:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-convert-datew-format-to-mmddyyw-format/m-p/672656#M202171</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-07-27T18:32:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert 8w. format to mmddyyw. format?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-datew-format-to-mmddyyw-format/m-p/672657#M202172</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/329937"&gt;@takpdpb7&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;For example: I have the original DOB as '01JAN2020'. I would like to convert it to '01/01/2020'&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Do you have a character variable or a numeric variable? (SAS only has &lt;STRONG&gt;two&lt;/STRONG&gt; types.)&lt;/P&gt;
&lt;P&gt;If you have a numeric variable change the format attached to have it displayed in the different way.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;format dob mmddyy10.;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If you have a character variable then convert it to a date value first.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;dob = put( input(dob,date9.) , mmddyy10.);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Note:&lt;/STRONG&gt; I assumed that the first 01 is the MONTH.&amp;nbsp; Others might assume it is DAY.&amp;nbsp; That is why you should use either DATE9. or YYMMDD10. format instead of MMDDYY10. or DDMMYY10. to avoid that confusion.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jul 2020 18:34:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-convert-datew-format-to-mmddyyw-format/m-p/672657#M202172</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-07-27T18:34:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert datew. format to mmddyyw. format?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-datew-format-to-mmddyyw-format/m-p/672658#M202173</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
    sas_date = '01JAN2020'd;
    dob = sas_date;
    dob2 = sas_date;
    format dob date9.
           dob2 mmddyys10.;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 27 Jul 2020 18:35:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-convert-datew-format-to-mmddyyw-format/m-p/672658#M202173</guid>
      <dc:creator>mklangley</dc:creator>
      <dc:date>2020-07-27T18:35:20Z</dc:date>
    </item>
  </channel>
</rss>

