<?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: Date Conversion in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Date-Conversion/m-p/241048#M44598</link>
    <description>&lt;P&gt;Hi Bob, May i request you to please enlighten me on the differences between applying $w. format and just like 8. format without the dollar sign. Also, &amp;nbsp;does applying an x amount of width caters to values less than the number of bytes in the value?&lt;/P&gt;
&lt;P&gt;This confuses me big time:(&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sorry for the bother and merry christmas and happy new year to you,&lt;/P&gt;
&lt;P&gt;Charlotte&lt;/P&gt;</description>
    <pubDate>Mon, 28 Dec 2015 18:19:36 GMT</pubDate>
    <dc:creator>CharlotteCain</dc:creator>
    <dc:date>2015-12-28T18:19:36Z</dc:date>
    <item>
      <title>Date Conversion</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-Conversion/m-p/241029#M44588</link>
      <description>&lt;P&gt;I have a SAS data set with a numeric variable (not date) with values like 20140815.&amp;nbsp; How can I turn this into a SAS date number that I willl eventually want in the format of MMDDYY8.&amp;nbsp; ?&lt;/P&gt;</description>
      <pubDate>Mon, 28 Dec 2015 17:10:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-Conversion/m-p/241029#M44588</guid>
      <dc:creator>Sharon421</dc:creator>
      <dc:date>2015-12-28T17:10:13Z</dc:date>
    </item>
    <item>
      <title>Re: Date Conversion</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-Conversion/m-p/241031#M44589</link>
      <description>&lt;P&gt;Use a combination of put() and input() functions.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Dec 2015 17:22:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-Conversion/m-p/241031#M44589</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2015-12-28T17:22:03Z</dc:date>
    </item>
    <item>
      <title>Re: Date Conversion</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-Conversion/m-p/241035#M44592</link>
      <description>&lt;P&gt;More specifically, the conversion would look like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;newvar = input(put(oldvar,8.), yymmdd8.);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then apply any date format you would like. &amp;nbsp;Any of these examples (and more) would be possible:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;format newvar date9.;&lt;/P&gt;
&lt;P&gt;format newvar yymmdd10.;&lt;/P&gt;
&lt;P&gt;format newvar mmddyy8.;&lt;/P&gt;
&lt;P&gt;format newvar mmddyys10.;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Experiment, till you find a format that you like.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Good luck.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Dec 2015 17:57:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-Conversion/m-p/241035#M44592</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2015-12-28T17:57:34Z</dc:date>
    </item>
    <item>
      <title>Re: Date Conversion</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-Conversion/m-p/241048#M44598</link>
      <description>&lt;P&gt;Hi Bob, May i request you to please enlighten me on the differences between applying $w. format and just like 8. format without the dollar sign. Also, &amp;nbsp;does applying an x amount of width caters to values less than the number of bytes in the value?&lt;/P&gt;
&lt;P&gt;This confuses me big time:(&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sorry for the bother and merry christmas and happy new year to you,&lt;/P&gt;
&lt;P&gt;Charlotte&lt;/P&gt;</description>
      <pubDate>Mon, 28 Dec 2015 18:19:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-Conversion/m-p/241048#M44598</guid>
      <dc:creator>CharlotteCain</dc:creator>
      <dc:date>2015-12-28T18:19:36Z</dc:date>
    </item>
    <item>
      <title>Re: Date Conversion</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-Conversion/m-p/241054#M44599</link>
      <description>&lt;P&gt;This seems simple on the surface but I could not figure it out.&amp;nbsp; This was a GREAT help.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Dec 2015 19:13:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-Conversion/m-p/241054#M44599</guid>
      <dc:creator>Sharon421</dc:creator>
      <dc:date>2015-12-28T19:13:10Z</dc:date>
    </item>
    <item>
      <title>Re: Date Conversion</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-Conversion/m-p/241063#M44605</link>
      <description>&lt;P&gt;Charlotte,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The $w formats expect to find character strings as the incoming values. &amp;nbsp;Leave out the dollar sign and the software expects a numeric as the incoming value.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you specify a width that is wider than the numeric value:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;newvar = put(12345678, 10.);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You get a leading blank (or as many leading blanks as needed) to fill out the resulting string. &amp;nbsp;Note that the PUT function always returns a character string regardless of whether the format is numeric or character.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When in doubt, experiment. &amp;nbsp;You can always check your results with something like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;newvar2 = '*' || newvar || '*';&lt;/P&gt;
&lt;P&gt;put newvar2=;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;People who are trying to learn are never a bother. &amp;nbsp;Merry Christmas to you as well.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Dec 2015 19:42:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-Conversion/m-p/241063#M44605</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2015-12-28T19:42:11Z</dc:date>
    </item>
  </channel>
</rss>

