<?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 Evaluating conditional start with a macro in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Evaluating-conditional-start-with-a-macro/m-p/856311#M338348</link>
    <description>&lt;P&gt;Hello.&lt;/P&gt;
&lt;P&gt;Could someone help understand why I cannot get this very simple macro to execute? When I run it I do get the params data from that step but nothing within the macro executes. On the initial run I get no failure at all, just no execution. On all subsequent runs I get,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"The quoted string currently being processed has become more than 262 characters long. You might have unbalanced quotation marks."&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This forces me to close SAS and reopen.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you very much.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data params;
	attrib 
		run_date		length = 8		format = mmddyy10.
		begin_date	length = 8		format = mmddyy10.
		ending_date 	length = 8		format = mmddyy10.
		rep_start_date length = $10
		rep_end_date	length = $10;

	run_date = today();
	run_month = month(run_date);
/*	begin_date = intnx('semiyear',run_date,1,"BEGIN");*/
/*	ending_date = intnx('semiyear',run_date,1,"END");*/
/*	rep_start_date = put(begin_date, mmddyy10.);*/
/*	rep_end_date = put(ending_date, mmddyy10.);*/

	call symput("run_month",run_month);
/*	call symput("begin_date",begin_date);*/
/*	call symput("ending_date",ending_date);*/
/*	call symput("rep_start_date",rep_start_date);*/
/*	call symput("rep_end_date",rep_end_date);*/
run;

%macro run_code;
	%if %eval(&amp;amp;run_month. = 1 or &amp;amp;run_month. = 7) %then %do;

data temp_01;
	test_var = 'This code actually ran.';
run;

	%end;
%mend;
%macro run_code;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 30 Jan 2023 19:03:26 GMT</pubDate>
    <dc:creator>Jeff_DOC</dc:creator>
    <dc:date>2023-01-30T19:03:26Z</dc:date>
    <item>
      <title>Evaluating conditional start with a macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Evaluating-conditional-start-with-a-macro/m-p/856311#M338348</link>
      <description>&lt;P&gt;Hello.&lt;/P&gt;
&lt;P&gt;Could someone help understand why I cannot get this very simple macro to execute? When I run it I do get the params data from that step but nothing within the macro executes. On the initial run I get no failure at all, just no execution. On all subsequent runs I get,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"The quoted string currently being processed has become more than 262 characters long. You might have unbalanced quotation marks."&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This forces me to close SAS and reopen.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you very much.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data params;
	attrib 
		run_date		length = 8		format = mmddyy10.
		begin_date	length = 8		format = mmddyy10.
		ending_date 	length = 8		format = mmddyy10.
		rep_start_date length = $10
		rep_end_date	length = $10;

	run_date = today();
	run_month = month(run_date);
/*	begin_date = intnx('semiyear',run_date,1,"BEGIN");*/
/*	ending_date = intnx('semiyear',run_date,1,"END");*/
/*	rep_start_date = put(begin_date, mmddyy10.);*/
/*	rep_end_date = put(ending_date, mmddyy10.);*/

	call symput("run_month",run_month);
/*	call symput("begin_date",begin_date);*/
/*	call symput("ending_date",ending_date);*/
/*	call symput("rep_start_date",rep_start_date);*/
/*	call symput("rep_end_date",rep_end_date);*/
run;

%macro run_code;
	%if %eval(&amp;amp;run_month. = 1 or &amp;amp;run_month. = 7) %then %do;

data temp_01;
	test_var = 'This code actually ran.';
run;

	%end;
%mend;
%macro run_code;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Jan 2023 19:03:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Evaluating-conditional-start-with-a-macro/m-p/856311#M338348</guid>
      <dc:creator>Jeff_DOC</dc:creator>
      <dc:date>2023-01-30T19:03:26Z</dc:date>
    </item>
    <item>
      <title>Re: Evaluating conditional start with a macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Evaluating-conditional-start-with-a-macro/m-p/856313#M338350</link>
      <description>&lt;P&gt;The last command should be&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%run_code
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What you had written&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro run_code;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;defines the macro %RUN_CODE again, there is never a %MEND; and so %RUN_CODE is essentially an unfinished macro and can't be used. Any text that is executed after that line becomes part of the unfinished macro and won't execute at all.&lt;/P&gt;</description>
      <pubDate>Mon, 30 Jan 2023 19:24:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Evaluating-conditional-start-with-a-macro/m-p/856313#M338350</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-01-30T19:24:50Z</dc:date>
    </item>
    <item>
      <title>Re: Evaluating conditional start with a macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Evaluating-conditional-start-with-a-macro/m-p/856316#M338351</link>
      <description>You did it. Thank you very much.</description>
      <pubDate>Mon, 30 Jan 2023 19:26:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Evaluating-conditional-start-with-a-macro/m-p/856316#M338351</guid>
      <dc:creator>Jeff_DOC</dc:creator>
      <dc:date>2023-01-30T19:26:39Z</dc:date>
    </item>
  </channel>
</rss>

