<?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 Global Macrovariable in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Global-Macrovariable/m-p/647979#M193983</link>
    <description>&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I created a macrovariable within a macro to do some checks. After that there is some more SAS Coding. I need to have &amp;amp;report_date. and &amp;amp;report_date_prev. as global macrovariables because they are also used in my SAS-coding after the macro, because right now after executing the %macro check, the macro variables are not definded for the whole proram&lt;/P&gt;&lt;P&gt;I can not build the macro around the whole code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;%Macro check;

data _null_;
	report_date_prev=intnx("month",today(),-1,"E");
	call symputx ("report_date_prev",report_date_prev);
run;
data current_month;
	set SOME TABLE;
	if start_date &amp;gt; &amp;amp;report_date_prev.;
run;
proc sql noprint;
	select min(start_date) format 8. into :start_date
	from current_month;
quit;
data _NULL_ ;
	report_date=intnx("weekday",intnx("month",today(),0,"B"),2);
	call symputx ("report_date", report_date);
run;
%if  %eval(&amp;amp;start_date. le &amp;amp;report_date.)  %then %do;
	%put Data ok;
	
%end;
%else %do;
	%PUT ERROR: Data is not updated;
	%abort;

%end;
%mend;
%check;&lt;/PRE&gt;&lt;P&gt;Thank you for your help&lt;/P&gt;</description>
    <pubDate>Fri, 15 May 2020 09:00:00 GMT</pubDate>
    <dc:creator>Jay_Aguilar</dc:creator>
    <dc:date>2020-05-15T09:00:00Z</dc:date>
    <item>
      <title>Global Macrovariable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Global-Macrovariable/m-p/647979#M193983</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I created a macrovariable within a macro to do some checks. After that there is some more SAS Coding. I need to have &amp;amp;report_date. and &amp;amp;report_date_prev. as global macrovariables because they are also used in my SAS-coding after the macro, because right now after executing the %macro check, the macro variables are not definded for the whole proram&lt;/P&gt;&lt;P&gt;I can not build the macro around the whole code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;%Macro check;

data _null_;
	report_date_prev=intnx("month",today(),-1,"E");
	call symputx ("report_date_prev",report_date_prev);
run;
data current_month;
	set SOME TABLE;
	if start_date &amp;gt; &amp;amp;report_date_prev.;
run;
proc sql noprint;
	select min(start_date) format 8. into :start_date
	from current_month;
quit;
data _NULL_ ;
	report_date=intnx("weekday",intnx("month",today(),0,"B"),2);
	call symputx ("report_date", report_date);
run;
%if  %eval(&amp;amp;start_date. le &amp;amp;report_date.)  %then %do;
	%put Data ok;
	
%end;
%else %do;
	%PUT ERROR: Data is not updated;
	%abort;

%end;
%mend;
%check;&lt;/PRE&gt;&lt;P&gt;Thank you for your help&lt;/P&gt;</description>
      <pubDate>Fri, 15 May 2020 09:00:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Global-Macrovariable/m-p/647979#M193983</guid>
      <dc:creator>Jay_Aguilar</dc:creator>
      <dc:date>2020-05-15T09:00:00Z</dc:date>
    </item>
    <item>
      <title>Re: Global Macrovariable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Global-Macrovariable/m-p/647981#M193985</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;one way:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;call symputx ("report_date", report_date, "G"); /* G - global */&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;other way:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%GLOBAL report_date;
data ...;
call symputx ("report_date", report_date);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Bart&lt;/P&gt;</description>
      <pubDate>Fri, 15 May 2020 09:36:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Global-Macrovariable/m-p/647981#M193985</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2020-05-15T09:36:38Z</dc:date>
    </item>
    <item>
      <title>Re: Global Macrovariable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Global-Macrovariable/m-p/647982#M193986</link>
      <description>Thank you very much</description>
      <pubDate>Fri, 15 May 2020 09:43:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Global-Macrovariable/m-p/647982#M193986</guid>
      <dc:creator>Jay_Aguilar</dc:creator>
      <dc:date>2020-05-15T09:43:46Z</dc:date>
    </item>
  </channel>
</rss>

