<?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: create binary macro var in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/create-binary-macro-var/m-p/882610#M348696</link>
    <description>&lt;P&gt;The macro variable &amp;amp;IND876 that you create inside the macro is available ONLY inside the macro.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can fix this by using a %GLOBAL statement inside the macro, or better yet just not doing this inside a macro.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let ind876 = %eval(&amp;amp;branch=876);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 27 Jun 2023 12:25:16 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2023-06-27T12:25:16Z</dc:date>
    <item>
      <title>create binary macro var</title>
      <link>https://communities.sas.com/t5/SAS-Programming/create-binary-macro-var/m-p/882608#M348695</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;user enter branch number in a macro var.&lt;/P&gt;
&lt;P&gt;The task is to create a new macro var that will get value 1 or 0.&lt;/P&gt;
&lt;P&gt;If branch=876&amp;nbsp; then the macro var will get value 1 ,else&amp;nbsp; value 0.&lt;/P&gt;
&lt;P&gt;What is the way to do it please?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
%let branch=876;
/*****%let branch=982;*******/
%macro Binary_Macro_Var;
%if &amp;amp;branch.=876 %then %do; 
%let Ind876=1;
%end; 
%else %do;
Ind876=0;
%end;
%mend Binary_Macro_Var; 
%Binary_Macro_Var
%put &amp;amp;Ind876.;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 27 Jun 2023 12:18:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/create-binary-macro-var/m-p/882608#M348695</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2023-06-27T12:18:38Z</dc:date>
    </item>
    <item>
      <title>Re: create binary macro var</title>
      <link>https://communities.sas.com/t5/SAS-Programming/create-binary-macro-var/m-p/882610#M348696</link>
      <description>&lt;P&gt;The macro variable &amp;amp;IND876 that you create inside the macro is available ONLY inside the macro.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can fix this by using a %GLOBAL statement inside the macro, or better yet just not doing this inside a macro.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let ind876 = %eval(&amp;amp;branch=876);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jun 2023 12:25:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/create-binary-macro-var/m-p/882610#M348696</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-06-27T12:25:16Z</dc:date>
    </item>
  </channel>
</rss>

