<?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: Checking a Variable from a Macro variable list in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Checking-a-Variable-from-a-Macro-variable-list/m-p/646953#M193572</link>
    <description>&lt;P&gt;If the macros contain data step statements, then this is a possible syntax:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if      COLUMN1='AAAA' then do; %process1; end;
else if COLUMN1='AAAE' then do; %process2; end;
else if COLUMN1='AAAX' then do; %process3; end;
else                        do; %process4; end;  &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 12 May 2020 03:40:01 GMT</pubDate>
    <dc:creator>ChrisNZ</dc:creator>
    <dc:date>2020-05-12T03:40:01Z</dc:date>
    <item>
      <title>Checking a Variable from a Macro variable list</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Checking-a-Variable-from-a-Macro-variable-list/m-p/646927#M193561</link>
      <description>&lt;P&gt;Hi ,&lt;/P&gt;
&lt;P&gt;Can someone suggest how to do the below.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;have :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Table1;&lt;/P&gt;
&lt;P&gt;&lt;U&gt;Column1&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;AAAA&lt;/P&gt;
&lt;P&gt;AAAE&lt;/P&gt;
&lt;P&gt;AAAX&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Want:&lt;/P&gt;
&lt;P&gt;if&amp;nbsp; 'AAAA'&amp;nbsp; in Column1 then do %process1;&lt;/P&gt;
&lt;P&gt;else if 'AAAE' in Column1 then do %process2;&lt;/P&gt;
&lt;P&gt;else if 'AAAX' in Column1 then do %process3;&lt;/P&gt;
&lt;P&gt;else %process4 ;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 May 2020 02:18:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Checking-a-Variable-from-a-Macro-variable-list/m-p/646927#M193561</guid>
      <dc:creator>dennis_oz</dc:creator>
      <dc:date>2020-05-12T02:18:20Z</dc:date>
    </item>
    <item>
      <title>Re: Checking a Variable from a Macro variable list</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Checking-a-Variable-from-a-Macro-variable-list/m-p/646932#M193564</link>
      <description>&lt;P&gt;Presuming the DATA step is simply dispatching macros that perform other steps, and do not need to feedback to the running DATA step...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Use either&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;doSubL() function, or&lt;/LI&gt;
&lt;LI&gt;CALL EXECUTE routine&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Example:&lt;/P&gt;
&lt;P&gt;%NRSTR is used to stack all invocations until DATA step finishes.&lt;/P&gt;
&lt;PRE&gt;data _null_;&lt;BR /&gt;  set have;&lt;BR /&gt;  select (Column1);&lt;BR /&gt;    when ('AAAA') call execute ('%nrstr(%process1))');  /* or rc=dosubl('%process1'); */&lt;BR /&gt;    when ('AAAE') call execute ('%nrstr(%process2))');  /* or rc=dosubl('%process2'); */&lt;BR /&gt;    when ('AAAX') call execute ('%nrstr(%process3))');  /* or rc=dosubl('%process3'); */&lt;BR /&gt;    otherwise     call execute ('%nrstr(%process4))');  /* or rc=dosubl('%process4'); */&lt;BR /&gt;  end;&lt;BR /&gt;run;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 May 2020 02:36:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Checking-a-Variable-from-a-Macro-variable-list/m-p/646932#M193564</guid>
      <dc:creator>RichardDeVen</dc:creator>
      <dc:date>2020-05-12T02:36:34Z</dc:date>
    </item>
    <item>
      <title>Re: Checking a Variable from a Macro variable list</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Checking-a-Variable-from-a-Macro-variable-list/m-p/646953#M193572</link>
      <description>&lt;P&gt;If the macros contain data step statements, then this is a possible syntax:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if      COLUMN1='AAAA' then do; %process1; end;
else if COLUMN1='AAAE' then do; %process2; end;
else if COLUMN1='AAAX' then do; %process3; end;
else                        do; %process4; end;  &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 May 2020 03:40:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Checking-a-Variable-from-a-Macro-variable-list/m-p/646953#M193572</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2020-05-12T03:40:01Z</dc:date>
    </item>
  </channel>
</rss>

