<?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: SAS macro variable with conditions in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SAS-macro-variable-with-conditions/m-p/474073#M121753</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%Macro Month_Pre_Selection (close, period1);
%global input_contracts ;
...........&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 28 Jun 2018 13:46:22 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2018-06-28T13:46:22Z</dc:date>
    <item>
      <title>SAS macro variable with conditions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-macro-variable-with-conditions/m-p/474071#M121752</link>
      <description>&lt;P&gt;Hi experts,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have the following macro and I want the macro to assign correct values.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%Macro Month_Pre_Selection (close, period1);

%if &amp;amp;Close. = 1 %then %do;

	%let input_contracts = CONTRACT_&amp;amp;period1.; 
	%let input_customers = CUSTOMER_&amp;amp;period1.;
	%let input_object = OBJECT_&amp;amp;period1.;
	%let input_payplan = PAYMENTPLAN_&amp;amp;period1.;

%end;

%if &amp;amp;Close. = 2 %then %do;

	%let input_contracts = CONTRACT_&amp;amp;period1._PRE; 
	%let input_customers = CUSTOMER_&amp;amp;period1._PRE; 
	%let input_object = OBJECT_&amp;amp;period1._PRE;
	%let input_payplan = PAYMENTPLAN_&amp;amp;period1._PRE;

%end;

%mend;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;when I run it with following code&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%Month_Pre_Selection (1, 201805);

%put &amp;amp;input_contracts;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I get the following message in the log&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;WARNING: Apparent symbolic reference INPUT_CONTRACTS not resolved.
&amp;amp;input_contracts&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;What am I doing wrong?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jun 2018 13:42:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-macro-variable-with-conditions/m-p/474071#M121752</guid>
      <dc:creator>Myurathan</dc:creator>
      <dc:date>2018-06-28T13:42:32Z</dc:date>
    </item>
    <item>
      <title>Re: SAS macro variable with conditions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-macro-variable-with-conditions/m-p/474073#M121753</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%Macro Month_Pre_Selection (close, period1);
%global input_contracts ;
...........&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 28 Jun 2018 13:46:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-macro-variable-with-conditions/m-p/474073#M121753</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2018-06-28T13:46:22Z</dc:date>
    </item>
    <item>
      <title>Re: SAS macro variable with conditions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-macro-variable-with-conditions/m-p/474076#M121756</link>
      <description>&lt;P&gt;Or move the %PUT statement inside the macro.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jun 2018 13:52:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-macro-variable-with-conditions/m-p/474076#M121756</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-06-28T13:52:20Z</dc:date>
    </item>
  </channel>
</rss>

