<?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: Simplify Macro - Dates? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Simplify-Macro-Dates/m-p/593402#M170285</link>
    <description>&lt;P&gt;Not from me, but those individual variables will be used in the next checking procedure.&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 02 Oct 2019 14:54:36 GMT</pubDate>
    <dc:creator>ybz12003</dc:creator>
    <dc:date>2019-10-02T14:54:36Z</dc:date>
    <item>
      <title>Simplify Macro - Dates?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Simplify-Macro-Dates/m-p/593389#M170281</link>
      <description>&lt;P&gt;Good morning,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have the following long codes, I am wondering if I could use a macro to simply this procedure.&amp;nbsp; Thanks in advance.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let startdate_2016=01JUL2016; 
%let enddate_2016=30JUN2017; 
%let startdate_2015=01JUL2015;
%let enddate_2015=30JUN2016;
%let startdate_2014=01JUL2014;
%let enddate_2014=30JUN2015;
%let startdate_2013=01JUL2013;
%let enddate_2013=30JUN2014;
%let startdate_2012=01JUL2012;
%let enddate_2012=30JUN2013;
%let startdate_2011=01JUL2011; 
%let enddate_2011=30JUN2012; 
%let startdate_2010=01JUL2010;
%let enddate_2010=30JUN2011;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 02 Oct 2019 14:33:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Simplify-Macro-Dates/m-p/593389#M170281</guid>
      <dc:creator>ybz12003</dc:creator>
      <dc:date>2019-10-02T14:33:06Z</dc:date>
    </item>
    <item>
      <title>Re: Simplify Macro - Dates?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Simplify-Macro-Dates/m-p/593391#M170283</link>
      <description>&lt;P&gt;Why do you need so many macro variables?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let year=2016;
%let startdate=01JUL&amp;amp;year;
%let enddate=30JUN%eval(&amp;amp;year+1);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Anyway.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%do year=2010 %to 2016;
  %let startdate_&amp;amp;year=01JUL&amp;amp;year;
  %let enddate_&amp;amp;year=30JUN%eval(&amp;amp;year+1);
%end;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 02 Oct 2019 14:38:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Simplify-Macro-Dates/m-p/593391#M170283</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-10-02T14:38:06Z</dc:date>
    </item>
    <item>
      <title>Re: Simplify Macro - Dates?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Simplify-Macro-Dates/m-p/593395#M170284</link>
      <description>&lt;P&gt;How about using a data step loop?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
    do start_year=2010 to 2016;
    call symputx(cats('startdate_',year),mdy(7,1,year));
    call symputx(cats('enddate_',year),mdy(6,30,year+1));
    end;
run;&lt;/CODE&gt;&amp;nbsp;&amp;nbsp;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Oct 2019 14:43:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Simplify-Macro-Dates/m-p/593395#M170284</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-10-02T14:43:30Z</dc:date>
    </item>
    <item>
      <title>Re: Simplify Macro - Dates?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Simplify-Macro-Dates/m-p/593402#M170285</link>
      <description>&lt;P&gt;Not from me, but those individual variables will be used in the next checking procedure.&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Oct 2019 14:54:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Simplify-Macro-Dates/m-p/593402#M170285</guid>
      <dc:creator>ybz12003</dc:creator>
      <dc:date>2019-10-02T14:54:36Z</dc:date>
    </item>
    <item>
      <title>Re: Simplify Macro - Dates?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Simplify-Macro-Dates/m-p/593406#M170288</link>
      <description>&lt;P&gt;Hi Tom,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Got error message in Log.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;15 %do year=2010 %to 2016;&lt;BR /&gt;ERROR: The %DO statement is not valid in open code.&lt;BR /&gt;16 %let startdate_&amp;amp;year=01JUL&amp;amp;year;&lt;BR /&gt;WARNING: Apparent symbolic reference YEAR not resolved.&lt;BR /&gt;ERROR: Symbolic variable name STARTDATE_&amp;amp;YEAR must contain only letters, digits, and underscores.&lt;BR /&gt;17 %let enddate_&amp;amp;year=30JUN%eval(&amp;amp;year+1);&lt;BR /&gt;WARNING: Apparent symbolic reference YEAR not resolved.&lt;BR /&gt;ERROR: Symbolic variable name ENDDATE_&amp;amp;YEAR must contain only letters, digits, and underscores.&lt;BR /&gt;18 %end;&lt;BR /&gt;ERROR: The %END statement is not valid in open code.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Oct 2019 15:02:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Simplify-Macro-Dates/m-p/593406#M170288</guid>
      <dc:creator>ybz12003</dc:creator>
      <dc:date>2019-10-02T15:02:31Z</dc:date>
    </item>
    <item>
      <title>Re: Simplify Macro - Dates?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Simplify-Macro-Dates/m-p/593410#M170291</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/67134"&gt;@ybz12003&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi Tom,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Got error message in Log.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;15 %do year=2010 %to 2016;&lt;BR /&gt;ERROR: The %DO statement is not valid in open code.&lt;BR /&gt;16 %let startdate_&amp;amp;year=01JUL&amp;amp;year;&lt;BR /&gt;WARNING: Apparent symbolic reference YEAR not resolved.&lt;BR /&gt;ERROR: Symbolic variable name STARTDATE_&amp;amp;YEAR must contain only letters, digits, and underscores.&lt;BR /&gt;17 %let enddate_&amp;amp;year=30JUN%eval(&amp;amp;year+1);&lt;BR /&gt;WARNING: Apparent symbolic reference YEAR not resolved.&lt;BR /&gt;ERROR: Symbolic variable name ENDDATE_&amp;amp;YEAR must contain only letters, digits, and underscores.&lt;BR /&gt;18 %end;&lt;BR /&gt;ERROR: The %END statement is not valid in open code.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You have to run the %DO loop inside a macro. Or use the DATA step I provided.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Oct 2019 15:04:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Simplify-Macro-Dates/m-p/593410#M170291</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-10-02T15:04:51Z</dc:date>
    </item>
    <item>
      <title>Re: Simplify Macro - Dates?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Simplify-Macro-Dates/m-p/593431#M170297</link>
      <description>&lt;P&gt;Hi PaigeMiller,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your codes are shown error too.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;19 data _null_;&lt;BR /&gt;20 do start_year=2010 to 2016;&lt;BR /&gt;21 call symputx(cats('startdate_',year),mdy(7,1,year));&lt;BR /&gt;22 call symputx(cats('enddate_',year),mdy(6,30,year+1));&lt;BR /&gt;23 end;&lt;BR /&gt;24 run;&lt;/P&gt;
&lt;P&gt;NOTE: Variable year is uninitialized.&lt;BR /&gt;ERROR: Symbolic variable name STARTDATE_. must contain only letters, digits, and underscores.&lt;BR /&gt;NOTE: Argument 1 to function SYMPUTX('startdate_.',.) at line 21 column 10 is invalid.&lt;BR /&gt;ERROR: Symbolic variable name ENDDATE_. must contain only letters, digits, and underscores.&lt;BR /&gt;NOTE: Argument 1 to function SYMPUTX('enddate_.',.) at line 22 column 10 is invalid.&lt;BR /&gt;ERROR: Symbolic variable name STARTDATE_. must contain only letters, digits, and underscores.&lt;BR /&gt;NOTE: Argument 1 to function SYMPUTX('startdate_.',.) at line 21 column 10 is invalid.&lt;BR /&gt;ERROR: Symbolic variable name ENDDATE_. must contain only letters, digits, and underscores.&lt;BR /&gt;NOTE: Argument 1 to function SYMPUTX('enddate_.',.) at line 22 column 10 is invalid.&lt;BR /&gt;ERROR: Symbolic variable name STARTDATE_. must contain only letters, digits, and underscores.&lt;BR /&gt;NOTE: Argument 1 to function SYMPUTX('startdate_.',.) at line 21 column 10 is invalid.&lt;BR /&gt;ERROR: Symbolic variable name ENDDATE_. must contain only letters, digits, and underscores.&lt;BR /&gt;NOTE: Argument 1 to function SYMPUTX('enddate_.',.) at line 22 column 10 is invalid.&lt;BR /&gt;ERROR: Symbolic variable name STARTDATE_. must contain only letters, digits, and underscores.&lt;BR /&gt;NOTE: Argument 1 to function SYMPUTX('startdate_.',.) at line 21 column 10 is invalid.&lt;BR /&gt;ERROR: Symbolic variable name ENDDATE_. must contain only letters, digits, and underscores.&lt;BR /&gt;NOTE: Argument 1 to function SYMPUTX('enddate_.',.) at line 22 column 10 is invalid.&lt;BR /&gt;ERROR: Symbolic variable name STARTDATE_. must contain only letters, digits, and underscores.&lt;BR /&gt;NOTE: Argument 1 to function SYMPUTX('startdate_.',.) at line 21 column 10 is invalid.&lt;BR /&gt;ERROR: Symbolic variable name ENDDATE_. must contain only letters, digits, and underscores.&lt;BR /&gt;NOTE: Argument 1 to function SYMPUTX('enddate_.',.) at line 22 column 10 is invalid.&lt;BR /&gt;ERROR: Symbolic variable name STARTDATE_. must contain only letters, digits, and underscores.&lt;BR /&gt;NOTE: Argument 1 to function SYMPUTX('startdate_.',.) at line 21 column 10 is invalid.&lt;BR /&gt;ERROR: Symbolic variable name ENDDATE_. must contain only letters, digits, and underscores.&lt;BR /&gt;NOTE: Argument 1 to function SYMPUTX('enddate_.',.) at line 22 column 10 is invalid.&lt;BR /&gt;ERROR: Symbolic variable name STARTDATE_. must contain only letters, digits, and underscores.&lt;BR /&gt;NOTE: Argument 1 to function SYMPUTX('startdate_.',.) at line 21 column 10 is invalid.&lt;BR /&gt;ERROR: Symbolic variable name ENDDATE_. must contain only letters, digits, and underscores.&lt;BR /&gt;NOTE: Argument 1 to function SYMPUTX('enddate_.',.) at line 22 column 10 is invalid.&lt;BR /&gt;start_year=2017 year=. _ERROR_=1 _N_=1&lt;BR /&gt;NOTE: Missing values were generated as a result of performing an operation on missing values.&lt;BR /&gt;Each place is given by: (Number of times) at (Line):(Column).&lt;BR /&gt;7 at -22:-53 7 at 21:42 7 at 22:40&lt;BR /&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;real time 0.31 seconds&lt;BR /&gt;cpu time 0.21 seconds&lt;/P&gt;</description>
      <pubDate>Wed, 02 Oct 2019 15:32:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Simplify-Macro-Dates/m-p/593431#M170297</guid>
      <dc:creator>ybz12003</dc:creator>
      <dc:date>2019-10-02T15:32:03Z</dc:date>
    </item>
    <item>
      <title>Re: Simplify Macro - Dates?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Simplify-Macro-Dates/m-p/593435#M170301</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/67134"&gt;@ybz12003&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Not from me, but those individual variables will be used in the next checking procedure.&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;The specific list of values you show makes me suspect that someone does not know how to use the INTNX function to get the start/end value of a month.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would say just seeing that many macro variables that the process is likely overly convoluted and possibly trying to force a spreadsheet solution onto SAS data by maintaining poor structures and using "loopy" code instead of By group processing.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Oct 2019 15:36:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Simplify-Macro-Dates/m-p/593435#M170301</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-10-02T15:36:43Z</dc:date>
    </item>
    <item>
      <title>Re: Simplify Macro - Dates?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Simplify-Macro-Dates/m-p/593437#M170302</link>
      <description>&lt;P&gt;You can fix that yourself. The log is even giving you hint if you are having trouble seeing it.&lt;/P&gt;
&lt;PRE&gt;NOTE: Variable year is uninitialized.&lt;/PRE&gt;</description>
      <pubDate>Wed, 02 Oct 2019 15:37:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Simplify-Macro-Dates/m-p/593437#M170302</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-10-02T15:37:09Z</dc:date>
    </item>
    <item>
      <title>Re: Simplify Macro - Dates?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Simplify-Macro-Dates/m-p/593438#M170303</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/67134"&gt;@ybz12003&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi PaigeMiller,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your codes are shown error too.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;19 data _null_;&lt;BR /&gt;20 do start_year=2010 to 2016;&lt;BR /&gt;21 call symputx(cats('startdate_',year),mdy(7,1,year));&lt;BR /&gt;22 call symputx(cats('enddate_',year),mdy(6,30,year+1));&lt;BR /&gt;23 end;&lt;BR /&gt;24 run;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;NOTE: Variable year is uninitialized.&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Yes, that was my mistake, which you should be able to fix easily&lt;/P&gt;</description>
      <pubDate>Wed, 02 Oct 2019 15:40:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Simplify-Macro-Dates/m-p/593438#M170303</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-10-02T15:40:12Z</dc:date>
    </item>
  </channel>
</rss>

