<?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: How to - Get Specified Values By Taking Specified Digits From Variables Values - For Macro Varia in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-Get-Specified-Values-By-Taking-Specified-Digits-From/m-p/280815#M56813</link>
    <description>&lt;P&gt;A small change is all that is required:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if variable in : (&amp;amp;macro.);&lt;/P&gt;</description>
    <pubDate>Tue, 28 Jun 2016 14:55:31 GMT</pubDate>
    <dc:creator>Astounding</dc:creator>
    <dc:date>2016-06-28T14:55:31Z</dc:date>
    <item>
      <title>How to - Get Specified Values By Taking Specified Digits From Variables Values - For Macro Variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-Get-Specified-Values-By-Taking-Specified-Digits-From/m-p/280807#M56810</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to get following "Variable" column's first three digits.&lt;/P&gt;&lt;P&gt;I define the first three digits i.e:"WOE", "REP". If I use "=:" option then I write first three digits, it brings my desired values but what if I have more than one value. Sometimes, I need 5 or 6 values i.e:"WOE","REP","IMP","ITA","BEL" etc. so I want to put these values into macro variable then use into my code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope I could make myself clear. Can you help me about to reach my aim, please?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data Have;
Do i=1 to 5;
Variable="WOE_Hart";
Output;
End;
Do i=1 to 5;
Variable="REP_Buff";
Output;
End;
Do i=1 to 5;
Variable="IMP_Steph";
Output;
End;
Run;
 
Data Want2;
Set Have;
If Variable=:"REP" Or Variable =:"IMP" Or Variable=:"ASK ";
Run;

%Let Macro= "WOE" "REP"; 

Data Want3;
Set Have;
If Variable =:(&amp;amp;Macro.);
Run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jun 2016 14:43:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-Get-Specified-Values-By-Taking-Specified-Digits-From/m-p/280807#M56810</guid>
      <dc:creator>ertr</dc:creator>
      <dc:date>2016-06-28T14:43:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to - Get Specified Values By Taking Specified Digits From Variables Values - For Macro Varia</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-Get-Specified-Values-By-Taking-Specified-Digits-From/m-p/280814#M56812</link>
      <description>&lt;P&gt;Take a substring and compare that.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If substr(variable, 1,3) in ('REP', ...,'ASK') then ...&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jun 2016 14:55:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-Get-Specified-Values-By-Taking-Specified-Digits-From/m-p/280814#M56812</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-06-28T14:55:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to - Get Specified Values By Taking Specified Digits From Variables Values - For Macro Varia</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-Get-Specified-Values-By-Taking-Specified-Digits-From/m-p/280815#M56813</link>
      <description>&lt;P&gt;A small change is all that is required:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if variable in : (&amp;amp;macro.);&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jun 2016 14:55:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-Get-Specified-Values-By-Taking-Specified-Digits-From/m-p/280815#M56813</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2016-06-28T14:55:31Z</dc:date>
    </item>
  </channel>
</rss>

