<?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 delete one macro variable for another macro variable? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/how-to-delete-one-macro-variable-for-another-macro-variable/m-p/109809#M22804</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Awesome. All works fine. Thank you all so much.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 01 Sep 2012 08:28:06 GMT</pubDate>
    <dc:creator>TomiKong</dc:creator>
    <dc:date>2012-09-01T08:28:06Z</dc:date>
    <item>
      <title>how to delete one macro variable for another macro variable?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-delete-one-macro-variable-for-another-macro-variable/m-p/109800#M22795</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;%let x=a1-a10;&lt;/P&gt;&lt;P&gt;%let y=a6;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;how to delete &amp;amp;y (a6) from &amp;amp;x efficiently?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Aug 2012 04:42:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-delete-one-macro-variable-for-another-macro-variable/m-p/109800#M22795</guid>
      <dc:creator>TomiKong</dc:creator>
      <dc:date>2012-08-31T04:42:42Z</dc:date>
    </item>
    <item>
      <title>Re: how to delete one macro variable for another macro variable?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-delete-one-macro-variable-for-another-macro-variable/m-p/109801#M22796</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can't delete it from x, because it's not in x to begin with.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What you've done here is define &amp;amp;x as the literal string "a1-a10". I assuming you're thinking of this as a list of variables a1, a2, ..., a10, but when you define "%let x=a1-a10" SAS doesn't perform that interpretation. SAS will substitute the characters "a1-a10" in the code where "&amp;amp;x" appears and only then will it interpret it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Demonstration:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%let x=a1-a3;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data test;&lt;/P&gt;&lt;P&gt;a1=5;&lt;/P&gt;&lt;P&gt;a2=6;&lt;/P&gt;&lt;P&gt;a3=7;&lt;/P&gt;&lt;P&gt;diff=&amp;amp;x;&lt;/P&gt;&lt;P&gt;sum=sum(of &amp;amp;x);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When you run this code, the first thing SAS does is to substitute "a1-a3" where "&amp;amp;x" appears:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data test;&lt;/P&gt;&lt;P&gt;a1=5;&lt;/P&gt;&lt;P&gt;a2=6;&lt;/P&gt;&lt;P&gt;a3=7;&lt;/P&gt;&lt;P&gt;diff=a1-a3;&lt;/P&gt;&lt;P&gt;sum=sum(of a1-a3);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It then interprets based on context. In the first case, it interprets "a1-a3" as a1 minus a3 (= 5-7 = -2); in the second case it interprets it as "a1, a2, a3" (= 5+6+7 = 18).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you can give some more context on what you're looking to do, people might be able to suggest some other solution.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Aug 2012 06:07:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-delete-one-macro-variable-for-another-macro-variable/m-p/109801#M22796</guid>
      <dc:creator>GeoffreyBrent</dc:creator>
      <dc:date>2012-08-31T06:07:50Z</dc:date>
    </item>
    <item>
      <title>Re: how to delete one macro variable for another macro variable?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-delete-one-macro-variable-for-another-macro-variable/m-p/109802#M22797</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The first answer you got was correct.&amp;nbsp; But there may be ways to program around it.&amp;nbsp; It all depends on what you need your application to do.&amp;nbsp; Here is one possible workaround, for one particular application:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;total = sum(of &amp;amp;x, -&amp;amp;y);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are also ways to get macro language to parse the variable list into individual names.&amp;nbsp; After that is done, it would be possible to remove &amp;amp;y from that list of individual names.&amp;nbsp; But as the first reply noted, give us more context.&amp;nbsp; How will you be using &amp;amp;x?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Aug 2012 14:14:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-delete-one-macro-variable-for-another-macro-variable/m-p/109802#M22797</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2012-08-31T14:14:23Z</dc:date>
    </item>
    <item>
      <title>Re: how to delete one macro variable for another macro variable?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-delete-one-macro-variable-for-another-macro-variable/m-p/109803#M22798</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Geoffrey, Astounding,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;Thanks a lot for your kind reply. &lt;/P&gt;&lt;P&gt;X (a1-a10) are independent variable candidates for regression. Miss rate will be calculated for each of them. Then I will remove these with high miss rate from X. &lt;/P&gt;&lt;P&gt;I want to write one macro to do this automatically. But I still have no clue to remove variable with high miss rate from list...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Aug 2012 16:15:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-delete-one-macro-variable-for-another-macro-variable/m-p/109803#M22798</guid>
      <dc:creator>TomiKong</dc:creator>
      <dc:date>2012-08-31T16:15:59Z</dc:date>
    </item>
    <item>
      <title>Re: how to delete one macro variable for another macro variable?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-delete-one-macro-variable-for-another-macro-variable/m-p/109804#M22799</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This may be something like you are looking for.&amp;nbsp; Each list X and Y are expanded and then any name in Y is removed from X and a new macro variable is created &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt; font-family: 'SAS Monospace';"&gt;NOTE: NEWX=a1 a2 a3 a4 a5 A7 A8 A9 A10&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt; font-family: 'SAS Monospace';"&gt;This will work for any type of "SAS Variable List" as long as the variables exist in a data set.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: navy; background: white; font-size: 10pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt; test;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: blue; font-family: 'Courier New';"&gt;length&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt; a1-a5 A6-A12 &lt;/SPAN&gt;&lt;SPAN style="color: teal; background: white; font-size: 10pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;8.&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt;;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: blue; font-family: 'Courier New';"&gt;stop&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt;;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: blue; font-family: 'Courier New';"&gt;call&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt; missing(of _all_);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: navy; background: white; font-size: 10pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt;;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 10pt; background: white; color: blue; font-family: 'Courier New';"&gt;%let&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt; x=a1-a10;&lt;SPAN style="font-size: 10pt; background: white; color: blue; font-family: 'Courier New';"&gt;%let&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt; y=a6;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="color: navy; background: white; font-size: 10pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN style="color: navy; background: white; font-size: 10pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;transpose&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN style="font-size: 10pt; background: white; color: blue; font-family: 'Courier New';"&gt;data&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt;=test(obs=&lt;/SPAN&gt;&lt;SPAN style="color: teal; background: white; font-size: 10pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;0&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt;) &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: blue; font-family: 'Courier New';"&gt;out&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt;=x;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: blue; font-family: 'Courier New';"&gt;var&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt; &amp;amp;x;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: navy; background: white; font-size: 10pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt;;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; background: white; font-size: 10pt; font-family: 'Courier New';"&gt;&lt;SPAN style="color: navy; background: white; font-size: 10pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN style="color: navy; background: white; font-size: 10pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;transpose&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN style="font-size: 10pt; background: white; color: blue; font-family: 'Courier New';"&gt;data&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt;=test(obs=&lt;/SPAN&gt;&lt;SPAN style="color: teal; background: white; font-size: 10pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;0&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt;) &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: blue; font-family: 'Courier New';"&gt;out&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt;=y;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: blue; font-family: 'Courier New';"&gt;var&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt; &amp;amp;y;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: navy; background: white; font-size: 10pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt;;&lt;BR /&gt;&lt;SPAN style="color: navy; background: white; font-size: 10pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN style="color: navy; background: white; font-size: 10pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;sql&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN style="font-size: 10pt; background: white; color: blue; font-family: 'Courier New';"&gt;noprint&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt;;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: blue; font-family: 'Courier New';"&gt;select&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt; _name_ &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: blue; font-family: 'Courier New';"&gt;into&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt; :newX separated &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: blue; font-family: 'Courier New';"&gt;by&lt;/SPAN&gt; &lt;SPAN style="font-size: 10pt; background: white; color: purple; font-family: 'Courier New';"&gt;' '&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: blue; font-family: 'Courier New';"&gt;from&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt; X&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: blue; font-family: 'Courier New';"&gt;where&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt; _name_ ne &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: blue; font-family: 'Courier New';"&gt;ALL&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: blue; font-family: 'Courier New';"&gt;select&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt; _name_ &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: blue; font-family: 'Courier New';"&gt;from&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt; Y);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: navy; background: white; font-size: 10pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;quit&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt;;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: navy; background: white; font-size: 10pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt;;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; background: white; font-size: 10pt; font-family: 'Courier New';"&gt;&lt;SPAN style="font-size: 10pt; background: white; color: blue; font-family: 'Courier New';"&gt;%put&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt; NOTE: NEWX=&amp;amp;newX; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Aug 2012 16:33:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-delete-one-macro-variable-for-another-macro-variable/m-p/109804#M22799</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2012-08-31T16:33:36Z</dc:date>
    </item>
    <item>
      <title>Re: how to delete one macro variable for another macro variable?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-delete-one-macro-variable-for-another-macro-variable/m-p/109805#M22800</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Or ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN style="color: #0000ff;"&gt;%let&lt;/SPAN&gt; x=a01-a10;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN style="color: #0000ff;"&gt;%let&lt;/SPAN&gt; y=a06;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN style="color: #000080;"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/SPAN&gt; xx yy ;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN style="color: #0000ff;"&gt;keep&lt;/SPAN&gt; vn ;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN style="color: #0000ff;"&gt;array&lt;/SPAN&gt; xxx&lt;LI&gt; &amp;amp;x ;&lt;/LI&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN style="color: #0000ff;"&gt;array&lt;/SPAN&gt; yyy&lt;LI&gt; &amp;amp;y ;&lt;/LI&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN style="color: #0000ff;"&gt;do&lt;/SPAN&gt; i = &lt;SPAN style="color: #008080;"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN style="color: #0000ff;"&gt;to&lt;/SPAN&gt; dim(xxx) ; vn = vname(xxx&lt;I&gt;) ; &lt;SPAN style="color: #0000ff;"&gt;output&lt;/SPAN&gt; xx ; &lt;SPAN style="color: #0000ff;"&gt;end&lt;/SPAN&gt; ;&lt;/I&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN style="color: #0000ff;"&gt;do&lt;/SPAN&gt; i = &lt;SPAN style="color: #008080;"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN style="color: #0000ff;"&gt;to&lt;/SPAN&gt; dim(yyy) ; vn = vname(yyy&lt;I&gt;) ; &lt;SPAN style="color: #0000ff;"&gt;output&lt;/SPAN&gt; yy ; &lt;SPAN style="color: #0000ff;"&gt;end&lt;/SPAN&gt; ;&lt;/I&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px; color: #000080;"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;SPAN style="color: #000000;"&gt; ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px; color: #000080;"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;sql&lt;/STRONG&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff;"&gt;noprint&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN style="color: #0000ff;"&gt;select&lt;/SPAN&gt; vn &lt;SPAN style="color: #0000ff;"&gt;into&lt;/SPAN&gt; : z separated &lt;SPAN style="color: #0000ff;"&gt;by&lt;/SPAN&gt; &lt;SPAN style="color: #800080;"&gt;' '&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px; color: #0000ff;"&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;from&lt;SPAN style="color: #000000;"&gt; ( &lt;/SPAN&gt;select&lt;SPAN style="color: #000000;"&gt; vn &lt;/SPAN&gt;from&lt;SPAN style="color: #000000;"&gt; xx &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #0000ff;"&gt;except&lt;/SPAN&gt; &lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #0000ff;"&gt;select&lt;/SPAN&gt; vn &lt;SPAN style="color: #0000ff;"&gt;from&lt;/SPAN&gt; yy ) ;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN style="color: #0000ff;"&gt;drop&lt;/SPAN&gt; &lt;SPAN style="color: #0000ff;"&gt;table&lt;/SPAN&gt; xx, yy ;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px; color: #000080;"&gt;&lt;STRONG&gt;quit&lt;/STRONG&gt;&lt;SPAN style="color: #000000;"&gt; ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN style="color: #0000ff;"&gt;%put&lt;/SPAN&gt; &amp;amp;z ;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Aug 2012 21:08:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-delete-one-macro-variable-for-another-macro-variable/m-p/109805#M22800</guid>
      <dc:creator>Howles</dc:creator>
      <dc:date>2012-08-31T21:08:40Z</dc:date>
    </item>
    <item>
      <title>Re: how to delete one macro variable for another macro variable?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-delete-one-macro-variable-for-another-macro-variable/m-p/109806#M22801</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you only need to take out one variable name at a time, like your sample showed, you could just use the following simpler approach:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%let x=a1 a2 a3; %let y=a1;&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;new_x=tranwrd("&amp;amp;x","&amp;amp;y",'');&lt;/P&gt;&lt;P&gt;call symputx('x',new_x);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%put &amp;amp;x;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you have more than one variable names needs to be taken off the parent list, then you already have good answers above or use a little loop:&lt;/P&gt;&lt;P&gt;%let x=a1 a2 a3; %let y=a1 a3;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;x="&amp;amp;x"; y="&amp;amp;y";&lt;/P&gt;&lt;P&gt;do i=1 by 1 to countw(y);&lt;/P&gt;&lt;P&gt; _y=scan(y,i);&lt;/P&gt;&lt;P&gt; x=tranwrd(x,trim(_y),'');&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;call symputx('x',x);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%put &amp;amp;x;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Haikuo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Aug 2012 22:39:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-delete-one-macro-variable-for-another-macro-variable/m-p/109806#M22801</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2012-08-31T22:39:42Z</dc:date>
    </item>
    <item>
      <title>Re: how to delete one macro variable for another macro variable?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-delete-one-macro-variable-for-another-macro-variable/m-p/109807#M22802</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That's all good except it only works for enumerated variable lists.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to know about my SQL SELECT since I got "NE ALL" from your book why you chose to use EXCEPT, is one better than the other?&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Aug 2012 22:43:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-delete-one-macro-variable-for-another-macro-variable/m-p/109807#M22802</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2012-08-31T22:43:31Z</dc:date>
    </item>
    <item>
      <title>Re: how to delete one macro variable for another macro variable?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-delete-one-macro-variable-for-another-macro-variable/m-p/109808#M22803</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maybe you need to show your work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How do you calculate miss rate?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You may not have to REMOVE anything but just gen a new list of variables that have acceptable miss rate.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Aug 2012 22:53:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-delete-one-macro-variable-for-another-macro-variable/m-p/109808#M22803</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2012-08-31T22:53:09Z</dc:date>
    </item>
    <item>
      <title>Re: how to delete one macro variable for another macro variable?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-delete-one-macro-variable-for-another-macro-variable/m-p/109809#M22804</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Awesome. All works fine. Thank you all so much.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 01 Sep 2012 08:28:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-delete-one-macro-variable-for-another-macro-variable/m-p/109809#M22804</guid>
      <dc:creator>TomiKong</dc:creator>
      <dc:date>2012-09-01T08:28:06Z</dc:date>
    </item>
    <item>
      <title>Re: how to delete one macro variable for another macro variable?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-delete-one-macro-variable-for-another-macro-variable/m-p/109810#M22805</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I see you already have solutions, but you might (or might not) find that existing SAS regression options can save you the need to write your own macro.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For instance, PROC REG gives you options for stepwise selection (add variables with best explanatory power/remove variables with worst) or by using something like SELECTION=MAXR STOP=&amp;amp;MAXEXPVARS you can force SAS to choose the best n variables.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 02 Sep 2012 23:56:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-delete-one-macro-variable-for-another-macro-variable/m-p/109810#M22805</guid>
      <dc:creator>GeoffreyBrent</dc:creator>
      <dc:date>2012-09-02T23:56:36Z</dc:date>
    </item>
  </channel>
</rss>

