<?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 Establishing a variable with a date in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Establishing-a-variable-with-a-date/m-p/65347#M18643</link>
    <description>Quick dumb question here.&lt;BR /&gt;
&lt;BR /&gt;
I want to assign to a variable today's date minus 365 days.  How do I do this?  I'm sure it's quick and easy, but what I've done so far seems to take the literal value that I'm trying to assign; TODAY() - 365;.  I want to be able to establish this dynamically and not have to hard code the date each time I run the program.&lt;BR /&gt;
&lt;BR /&gt;
I need to pass this into a piece of PROC SQL code later in the program.&lt;BR /&gt;
&lt;BR /&gt;
Thanx.</description>
    <pubDate>Wed, 10 Dec 2008 16:35:10 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2008-12-10T16:35:10Z</dc:date>
    <item>
      <title>Establishing a variable with a date</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Establishing-a-variable-with-a-date/m-p/65347#M18643</link>
      <description>Quick dumb question here.&lt;BR /&gt;
&lt;BR /&gt;
I want to assign to a variable today's date minus 365 days.  How do I do this?  I'm sure it's quick and easy, but what I've done so far seems to take the literal value that I'm trying to assign; TODAY() - 365;.  I want to be able to establish this dynamically and not have to hard code the date each time I run the program.&lt;BR /&gt;
&lt;BR /&gt;
I need to pass this into a piece of PROC SQL code later in the program.&lt;BR /&gt;
&lt;BR /&gt;
Thanx.</description>
      <pubDate>Wed, 10 Dec 2008 16:35:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Establishing-a-variable-with-a-date/m-p/65347#M18643</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2008-12-10T16:35:10Z</dc:date>
    </item>
    <item>
      <title>Re: Establishing a variable with a date</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Establishing-a-variable-with-a-date/m-p/65348#M18644</link>
      <description>x = today() - 365;&lt;BR /&gt;
FORMAT x date9.&lt;BR /&gt;
&lt;BR /&gt;
will set "x" to one year ago today.  In SQL, that is just &lt;BR /&gt;
&lt;BR /&gt;
SELECT &lt;BR /&gt;
  (today() - 365) AS x&lt;BR /&gt;
&lt;BR /&gt;
You can add the format too in SQL, the syntax is in the manual.</description>
      <pubDate>Wed, 10 Dec 2008 22:35:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Establishing-a-variable-with-a-date/m-p/65348#M18644</guid>
      <dc:creator>Doc_Duke</dc:creator>
      <dc:date>2008-12-10T22:35:13Z</dc:date>
    </item>
    <item>
      <title>Re: Establishing a variable with a date</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Establishing-a-variable-with-a-date/m-p/65349#M18645</link>
      <description>Thanks.</description>
      <pubDate>Wed, 10 Dec 2008 22:41:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Establishing-a-variable-with-a-date/m-p/65349#M18645</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2008-12-10T22:41:02Z</dc:date>
    </item>
  </channel>
</rss>

