<?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 format MMDDYYYY10. to another date format? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-format-MMDDYYYY10-to-another-date-format/m-p/366270#M87120</link>
    <description>&lt;P&gt;If you want a format permanently associated with a variable you have to use a FORMAT statement in a data step or modify in proc datasets.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;The code I provided was just to demostrate that when you use the sddate format that the appearance is as you requested.&lt;/P&gt;
&lt;P&gt;It is up to you to attach or use the format when needed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data test;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; d ='6Aug2005'd;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; put d sddate.;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;STRONG&gt;format d sddate.;&lt;/STRONG&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;</description>
    <pubDate>Mon, 12 Jun 2017 18:12:34 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2017-06-12T18:12:34Z</dc:date>
    <item>
      <title>How to format MMDDYYYY10. to another date format?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-format-MMDDYYYY10-to-another-date-format/m-p/366168#M87082</link>
      <description>&lt;P&gt;Hello:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to change the&amp;nbsp;SAS format 09/15/2009 to 9/15/2009, or 08/06/2005 to 8/6/2005.&amp;nbsp; &amp;nbsp; Please let me know how.&amp;nbsp; Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Jun 2017 14:43:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-format-MMDDYYYY10-to-another-date-format/m-p/366168#M87082</guid>
      <dc:creator>ybz12003</dc:creator>
      <dc:date>2017-06-12T14:43:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to format MMDDYYYY10. to another date format?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-format-MMDDYYYY10-to-another-date-format/m-p/366174#M87086</link>
      <description>&lt;P&gt;Are you willing to create and use a custom date format? The behavior you request isn't supported by the SAS supplied formats.&lt;/P&gt;
&lt;PRE&gt;proc format library=work;
picture sddate 
low-high = '%m/%d/%Y' (datatype=date);
run;

data _null_;
  d ='6Aug2005'd;
  put d sddate.;
run;&lt;/PRE&gt;</description>
      <pubDate>Mon, 12 Jun 2017 14:53:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-format-MMDDYYYY10-to-another-date-format/m-p/366174#M87086</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-06-12T14:53:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to format MMDDYYYY10. to another date format?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-format-MMDDYYYY10-to-another-date-format/m-p/366185#M87092</link>
      <description>&lt;P&gt;Yes.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Jun 2017 15:12:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-format-MMDDYYYY10-to-another-date-format/m-p/366185#M87092</guid>
      <dc:creator>ybz12003</dc:creator>
      <dc:date>2017-06-12T15:12:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to format MMDDYYYY10. to another date format?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-format-MMDDYYYY10-to-another-date-format/m-p/366189#M87093</link>
      <description>&lt;P&gt;The code I copied from you didn't show the result I would like to.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;format&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;library&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=work;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;picture&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; sddate &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;low-high = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'%m/%d/%Y'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; (&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;datatype&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=date);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; test;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;d =&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;'05/06/2005'd&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;put&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; d &lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;sddate.&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Jun 2017 15:18:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-format-MMDDYYYY10-to-another-date-format/m-p/366189#M87093</guid>
      <dc:creator>ybz12003</dc:creator>
      <dc:date>2017-06-12T15:18:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to format MMDDYYYY10. to another date format?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-format-MMDDYYYY10-to-another-date-format/m-p/366207#M87096</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/67134"&gt;@ybz12003&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;The code I copied from you didn't show the result I would like to.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;format&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;library&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=work;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;picture&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; sddate &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;low-high = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'%m/%d/%Y'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; (&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;datatype&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=date);&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; test;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;d =&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;'05/06/2005'd&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;put&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; d &lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;sddate.&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Date literals must be of DATE7 or DATE9. such as 6MAY2005. Because there are so many different date formats in use only one is valid. For some folks the data you posted would be 5June2005, and for those that do not use a separator such as 201210 that could be: 20 Dec 2010, or October 2012. So you have to use the 3-letter month abbreviation and have day, Month, year&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And the code you ran was not a copy of what I provided.&lt;/P&gt;</description>
      <pubDate>Mon, 12 Jun 2017 16:06:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-format-MMDDYYYY10-to-another-date-format/m-p/366207#M87096</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-06-12T16:06:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to format MMDDYYYY10. to another date format?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-format-MMDDYYYY10-to-another-date-format/m-p/366209#M87097</link>
      <description>&lt;P&gt;I got 'd' value for 16654.&amp;nbsp; However, I would like the format is 8/6/2005&lt;/P&gt;</description>
      <pubDate>Mon, 12 Jun 2017 16:19:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-format-MMDDYYYY10-to-another-date-format/m-p/366209#M87097</guid>
      <dc:creator>ybz12003</dc:creator>
      <dc:date>2017-06-12T16:19:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to format MMDDYYYY10. to another date format?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-format-MMDDYYYY10-to-another-date-format/m-p/366234#M87109</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/67134"&gt;@ybz12003&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;I got 'd' value for 16654.&amp;nbsp; However, I would like the format is 8/6/2005&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;SAS date values are stored as a number of days from a base date of 1 Jan 1960.&lt;/P&gt;
&lt;P&gt;That value has no format applied so uses the best. format to display a numeric value.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Show your work!&lt;/P&gt;
&lt;P&gt;Please see the log when running this code.&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="SAS Monospace" size="2"&gt;data&lt;/FONT&gt;&lt;FONT face="SAS Monospace" size="2"&gt; junk;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="SAS Monospace" size="2"&gt; x = &lt;/FONT&gt;&lt;FONT color="#008080" face="SAS Monospace" size="2"&gt;'06AUG2005'd&lt;/FONT&gt;&lt;FONT face="SAS Monospace" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="SAS Monospace" size="2"&gt;put&lt;/FONT&gt; &lt;FONT color="#800080" face="SAS Monospace" size="2"&gt;'As integer '&lt;/FONT&gt;&lt;FONT face="SAS Monospace" size="2"&gt; x= &lt;/FONT&gt;&lt;FONT color="#804040" face="SAS Monospace" size="2"&gt;best10.&lt;/FONT&gt;&lt;FONT face="SAS Monospace" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="SAS Monospace" size="2"&gt;put&lt;/FONT&gt; &lt;FONT color="#800080" face="SAS Monospace" size="2"&gt;'date9 format '&lt;/FONT&gt;&lt;FONT face="SAS Monospace" size="2"&gt; x= &lt;/FONT&gt;&lt;FONT color="#804040" face="SAS Monospace" size="2"&gt;date9.&lt;/FONT&gt;&lt;FONT face="SAS Monospace" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="SAS Monospace" size="2"&gt;put&lt;/FONT&gt; &lt;FONT color="#800080" face="SAS Monospace" size="2"&gt;'mmddyy10 format '&lt;/FONT&gt;&lt;FONT face="SAS Monospace" size="2"&gt; x= &lt;/FONT&gt;&lt;FONT color="#804040" face="SAS Monospace" size="2"&gt;mmddyy10.&lt;/FONT&gt;&lt;FONT face="SAS Monospace" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="SAS Monospace" size="2"&gt;put&lt;/FONT&gt; &lt;FONT color="#800080" face="SAS Monospace" size="2"&gt;'sddate format '&lt;/FONT&gt;&lt;FONT face="SAS Monospace" size="2"&gt; x= &lt;/FONT&gt;&lt;FONT color="#804040" face="SAS Monospace" size="2"&gt;sddate.&lt;/FONT&gt;&lt;FONT face="SAS Monospace" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="SAS Monospace" size="2"&gt;run&lt;/FONT&gt;&lt;FONT face="SAS Monospace" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Jun 2017 17:15:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-format-MMDDYYYY10-to-another-date-format/m-p/366234#M87109</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-06-12T17:15:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to format MMDDYYYY10. to another date format?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-format-MMDDYYYY10-to-another-date-format/m-p/366243#M87113</link>
      <description>&lt;P&gt;Yes, on the log is shown that:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;15 data test;&lt;/P&gt;&lt;P&gt;16 d ='6Aug2005'd;&lt;/P&gt;&lt;P&gt;17 put d sddate.;&lt;/P&gt;&lt;P&gt;18 run;&lt;/P&gt;&lt;P&gt;8/6/2005&lt;/P&gt;&lt;P&gt;NOTE: The data set WORK.TEST has 1 observations and 1 variables.&lt;/P&gt;&lt;P&gt;NOTE: DATA statement used (Total process time):&lt;/P&gt;&lt;P&gt;real time 0.01 seconds&lt;/P&gt;&lt;P&gt;cpu time 0.00 seconds&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, when I open the test data set.&amp;nbsp; It shows:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE border="0" cellspacing="1" cellpadding="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;The SAS System&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV align="center"&gt;Obs d 1 &lt;TABLE cellspacing="0" cellpadding="5"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;16654&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 12 Jun 2017 17:29:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-format-MMDDYYYY10-to-another-date-format/m-p/366243#M87113</guid>
      <dc:creator>ybz12003</dc:creator>
      <dc:date>2017-06-12T17:29:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to format MMDDYYYY10. to another date format?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-format-MMDDYYYY10-to-another-date-format/m-p/366270#M87120</link>
      <description>&lt;P&gt;If you want a format permanently associated with a variable you have to use a FORMAT statement in a data step or modify in proc datasets.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;The code I provided was just to demostrate that when you use the sddate format that the appearance is as you requested.&lt;/P&gt;
&lt;P&gt;It is up to you to attach or use the format when needed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data test;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; d ='6Aug2005'd;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; put d sddate.;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;STRONG&gt;format d sddate.;&lt;/STRONG&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Jun 2017 18:12:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-format-MMDDYYYY10-to-another-date-format/m-p/366270#M87120</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-06-12T18:12:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to format MMDDYYYY10. to another date format?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-format-MMDDYYYY10-to-another-date-format/m-p/366277#M87124</link>
      <description>&lt;P&gt;Thanks.&amp;nbsp; It works. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Jun 2017 18:21:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-format-MMDDYYYY10-to-another-date-format/m-p/366277#M87124</guid>
      <dc:creator>ybz12003</dc:creator>
      <dc:date>2017-06-12T18:21:24Z</dc:date>
    </item>
  </channel>
</rss>

