<?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: explanation in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/explanation/m-p/118977#M24520</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You'll need to use %SYSFUNC for each function ... once for MONTH and once for TODAY.&amp;nbsp; I hope I get the number of parentheses correct:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%let month1x = %sysfunc(month(%sysfunc(today())));&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 21 Oct 2013 19:13:48 GMT</pubDate>
    <dc:creator>Astounding</dc:creator>
    <dc:date>2013-10-21T19:13:48Z</dc:date>
    <item>
      <title>explanation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/explanation/m-p/118974#M24517</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Hi, I came across a wierd situation. Can someone explain me this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One of our prod jobs is using %let statement as below and it works&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%let rundt = today();&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;however, when i run the same &amp;amp;rundt resolves to today() and not actual date of today.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've to use %let rundt = %sysfunc(today());&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;why is it that it works without %sysfunc in other jobs?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Oct 2013 17:19:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/explanation/m-p/118974#M24517</guid>
      <dc:creator>helloSAS</dc:creator>
      <dc:date>2013-10-21T17:19:52Z</dc:date>
    </item>
    <item>
      <title>Re: explanation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/explanation/m-p/118975#M24518</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The statements do the same thing, whether it is in your job or in a production job.&amp;nbsp; Whenever you see this statement:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%let rundt = today();&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the value of &amp;amp;RUNDT is not a number, but is the 7 characters "today()".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What you are not observing is how the production program uses &amp;amp;RUNDT.&amp;nbsp; For example, it may use this statement in a DATA step:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;date = &amp;amp;RUNDT;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In that case, the statement resolves into:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;date = today();&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When that statement appears in a DATA step, it executes and DATE receives the proper numeric value.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Oct 2013 17:36:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/explanation/m-p/118975#M24518</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2013-10-21T17:36:57Z</dc:date>
    </item>
    <item>
      <title>Re: explanation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/explanation/m-p/118976#M24519</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One more question&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Why am i not able to use below statement?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%let month1x = %sysfunc(month(today()));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where as, I'm able to use&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data _null_ ;&lt;/P&gt;&lt;P&gt;call symput('month1x',month(today()));&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Oct 2013 18:17:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/explanation/m-p/118976#M24519</guid>
      <dc:creator>helloSAS</dc:creator>
      <dc:date>2013-10-21T18:17:17Z</dc:date>
    </item>
    <item>
      <title>Re: explanation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/explanation/m-p/118977#M24520</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You'll need to use %SYSFUNC for each function ... once for MONTH and once for TODAY.&amp;nbsp; I hope I get the number of parentheses correct:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%let month1x = %sysfunc(month(%sysfunc(today())));&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Oct 2013 19:13:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/explanation/m-p/118977#M24520</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2013-10-21T19:13:48Z</dc:date>
    </item>
    <item>
      <title>Re: explanation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/explanation/m-p/118978#M24521</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was able to get same results using both ways below. However, I had to use&amp;nbsp; ' ' quotes around &lt;SPAN style="color: #ff0000;"&gt;month&lt;/SPAN&gt; in intnx function for call symput and not for %sysfunc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you tell me the reason why?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; %let month2 = %sysfunc(month(%sysfunc(intnx(&lt;SPAN style="color: #ff0000;"&gt;month&lt;/SPAN&gt;,%sysfunc(today()),-1))));&lt;BR /&gt;&amp;nbsp; %put &amp;amp;month2;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; data _null_;&lt;BR /&gt;&amp;nbsp; call symput ('month1',month(intnx(&lt;SPAN style="color: #ff0000;"&gt;'month',&lt;/SPAN&gt;today(),-1)));&lt;BR /&gt;&amp;nbsp; run;&lt;BR /&gt;&amp;nbsp; %put &amp;amp;month1;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Oct 2013 19:56:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/explanation/m-p/118978#M24521</guid>
      <dc:creator>helloSAS</dc:creator>
      <dc:date>2013-10-21T19:56:42Z</dc:date>
    </item>
    <item>
      <title>Re: explanation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/explanation/m-p/118979#M24522</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Except in rare cases where a number is required, macro language assumes all strings are text.&amp;nbsp; Easy examples:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%let name=Fred;&lt;/P&gt;&lt;P&gt;%let name="Fred";&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The first statement assigns &amp;amp;NAME a 4-character value.&amp;nbsp; The second assigns &amp;amp;NAME a 6-character value.&amp;nbsp; The quotes are not needed to identify a string, and so become part of the value assigned to &amp;amp;NAME.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You're looking at the same principle, but in a more complex setting.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Oct 2013 20:01:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/explanation/m-p/118979#M24522</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2013-10-21T20:01:07Z</dc:date>
    </item>
  </channel>
</rss>

