<?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: Generate Date constant for Macro variable based off the beginning of current month? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Generate-Date-constant-for-Macro-variable-based-off-the/m-p/607130#M176398</link>
    <description>&lt;P&gt;Your DATA step contains this invalid statement:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Column = 01NOV2019;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;It's invalid if you were to code it yourself, and just as invalid if macro language generates it.&lt;/P&gt;</description>
    <pubDate>Mon, 25 Nov 2019 22:13:10 GMT</pubDate>
    <dc:creator>Astounding</dc:creator>
    <dc:date>2019-11-25T22:13:10Z</dc:date>
    <item>
      <title>Generate Date constant for Macro variable based off the beginning of current month?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Generate-Date-constant-for-Macro-variable-based-off-the/m-p/607129#M176397</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I've been messing around with Macro's and it looks like I'm getting the "expected" output but it's throwing an error.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My expected result is 01NOV2019; which I will then use in reference later with&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;where date = "&amp;amp;Test"d&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Below is what I have thus far, the log is stating the correct output but it's also complaining about an error and my dataset is incomplete.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let day=%sysfunc(Today(), date9.);
%let Test=%sysfunc(intnx(month,"&amp;amp;day"d,0),date9.);
DATA TEST;
Column = &amp;amp;Test;
RUN;	&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;281884  %let day=%sysfunc(Today(), date9.);
281885  %let Test=%sysfunc(intnx(month,"&amp;amp;day"d,0),date9.);
281886  DATA TEST;
281887  Column = &amp;amp;Test;
NOTE: Line generated by the macro variable "TEST".
1        01NOV2019
           -------
           22
ERROR 22-322: Syntax error, expecting one of the following: !, !!, &amp;amp;, *, **, +, -, /, &amp;lt;, &amp;lt;=, &amp;lt;&amp;gt;, =, &amp;gt;, &amp;gt;&amp;lt;, &amp;gt;=, AND, EQ, GE, GT, IN, LE, LT, MAX, MIN, NE, NG, NL, NOTIN, OR, ^=, |, ||, ~=.

281888  RUN;
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Nov 2019 22:10:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Generate-Date-constant-for-Macro-variable-based-off-the/m-p/607129#M176397</guid>
      <dc:creator>Krueger</dc:creator>
      <dc:date>2019-11-25T22:10:26Z</dc:date>
    </item>
    <item>
      <title>Re: Generate Date constant for Macro variable based off the beginning of current month?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Generate-Date-constant-for-Macro-variable-based-off-the/m-p/607130#M176398</link>
      <description>&lt;P&gt;Your DATA step contains this invalid statement:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Column = 01NOV2019;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;It's invalid if you were to code it yourself, and just as invalid if macro language generates it.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Nov 2019 22:13:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Generate-Date-constant-for-Macro-variable-based-off-the/m-p/607130#M176398</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2019-11-25T22:13:10Z</dc:date>
    </item>
  </channel>
</rss>

