<?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: macro variable from today() in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/macro-variable-from-today/m-p/36636#M7217</link>
    <description>The standalone SAS snippet code below worked for me, as well.  You will need to add some diagnostics to your SAS program (similar to the %PUT below) and test the macro variable value at points in your program execution -- pay attention to how global and local macro variable resolution works - topic referred to as "scope of macro variables" and can be found at the SAS support  &lt;A href="http://support.sas.com/" target="_blank"&gt;http://support.sas.com/&lt;/A&gt;  website for your reference.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.&lt;BR /&gt;
&lt;BR /&gt;
data _null_;&lt;BR /&gt;
call symput ('today',put(today(),date7.));&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
%put _global_;</description>
    <pubDate>Tue, 26 May 2009 14:52:08 GMT</pubDate>
    <dc:creator>sbb</dc:creator>
    <dc:date>2009-05-26T14:52:08Z</dc:date>
    <item>
      <title>macro variable from today()</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-variable-from-today/m-p/36635#M7216</link>
      <description>I have the following bit of code, at the very beginning of a program being invoked by a batch file. The macro variable that is being derived from the today() function is not created -- why not? When I open the program, highlight and run this bit of code, it works.&lt;BR /&gt;
&lt;BR /&gt;
data _null_;&lt;BR /&gt;
call symput ('today',put(today(),date7.));&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
proc printto log="P:\Log\AutoRun_&amp;amp;today..log" NEW; run; &lt;BR /&gt;
proc printto print="P:\Log\AutoRunt_&amp;amp;today..lst" NEW; run; &lt;BR /&gt;
&lt;BR /&gt;
....</description>
      <pubDate>Tue, 26 May 2009 14:21:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-variable-from-today/m-p/36635#M7216</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-05-26T14:21:07Z</dc:date>
    </item>
    <item>
      <title>Re: macro variable from today()</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-variable-from-today/m-p/36636#M7217</link>
      <description>The standalone SAS snippet code below worked for me, as well.  You will need to add some diagnostics to your SAS program (similar to the %PUT below) and test the macro variable value at points in your program execution -- pay attention to how global and local macro variable resolution works - topic referred to as "scope of macro variables" and can be found at the SAS support  &lt;A href="http://support.sas.com/" target="_blank"&gt;http://support.sas.com/&lt;/A&gt;  website for your reference.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.&lt;BR /&gt;
&lt;BR /&gt;
data _null_;&lt;BR /&gt;
call symput ('today',put(today(),date7.));&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
%put _global_;</description>
      <pubDate>Tue, 26 May 2009 14:52:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-variable-from-today/m-p/36636#M7217</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2009-05-26T14:52:08Z</dc:date>
    </item>
    <item>
      <title>Re: macro variable from today()</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-variable-from-today/m-p/36637#M7218</link>
      <description>Don't forget that you have an automatic system macro variable &amp;amp;SYSDATE, which gives you the date your SAS session started.</description>
      <pubDate>Tue, 26 May 2009 15:58:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-variable-from-today/m-p/36637#M7218</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-05-26T15:58:47Z</dc:date>
    </item>
    <item>
      <title>Re: macro variable from today()</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-variable-from-today/m-p/36638#M7219</link>
      <description>You could also use this instead of the DATA step:&lt;BR /&gt;
&lt;BR /&gt;
%let today=%sysfunc(today(),date7.);</description>
      <pubDate>Fri, 29 May 2009 18:14:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-variable-from-today/m-p/36638#M7219</guid>
      <dc:creator>Russ_SAS</dc:creator>
      <dc:date>2009-05-29T18:14:24Z</dc:date>
    </item>
  </channel>
</rss>

