<?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: SAS DATES in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/SAS-DATES/m-p/108427#M30213</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I mean putting&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;8/1999&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 09 Oct 2013 18:38:19 GMT</pubDate>
    <dc:creator>robertrao</dc:creator>
    <dc:date>2013-10-09T18:38:19Z</dc:date>
    <item>
      <title>SAS DATES</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-DATES/m-p/108425#M30211</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;I have a macrovariable&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;and i want to convert it to a numeric date and store it for the entire dataset&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;%let monthyear=Aug1999;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;In the below the WANT table should have numeric AUG 1999 &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;data want;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;set have;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Oct 2013 17:07:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-DATES/m-p/108425#M30211</guid>
      <dc:creator>robertrao</dc:creator>
      <dc:date>2013-10-09T17:07:43Z</dc:date>
    </item>
    <item>
      <title>Re: SAS DATES</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-DATES/m-p/108426#M30212</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There is no such thing as a single numeric value that corresponds to all of August 1999.&amp;nbsp; Numeric SAS dates correspond to a single day.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can save it as a character variable in this fashion:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;monyr = "&amp;amp;monthyear";&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or you can save it as a numeric variable representing a particular day:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;monyr = "01&amp;amp;monthyear"d;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you prefer some other date other than the first of the month, that's obviously easy to change.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good luck.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Oct 2013 18:13:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-DATES/m-p/108426#M30212</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2013-10-09T18:13:08Z</dc:date>
    </item>
    <item>
      <title>Re: SAS DATES</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-DATES/m-p/108427#M30213</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I mean putting&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;8/1999&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Oct 2013 18:38:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-DATES/m-p/108427#M30213</guid>
      <dc:creator>robertrao</dc:creator>
      <dc:date>2013-10-09T18:38:19Z</dc:date>
    </item>
    <item>
      <title>Re: SAS DATES</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-DATES/m-p/108428#M30214</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;OK, this code could be used:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;num_date = "01&amp;amp;monthyear"d;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;length char_date $ 7;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;char_date = left(&amp;nbsp; put(month(num_date),2.) || '/' || put(year(num_date),4.)&amp;nbsp; );&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My recommendation would be to alter the result slightly, using a leading zero for months prior to October:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;char_date = put(month(num_date),z2.) || '/' || put(year(num_date),4.);&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Oct 2013 18:54:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-DATES/m-p/108428#M30214</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2013-10-09T18:54:09Z</dc:date>
    </item>
  </channel>
</rss>

