<?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: select into a macro variable inside a macro in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/select-into-a-macro-variable-inside-a-macro/m-p/363230#M64601</link>
    <description>&lt;P&gt;It worked. Thank you for the quick response!&lt;/P&gt;</description>
    <pubDate>Wed, 31 May 2017 21:23:58 GMT</pubDate>
    <dc:creator>Heraaaa</dc:creator>
    <dc:date>2017-05-31T21:23:58Z</dc:date>
    <item>
      <title>select into a macro variable inside a macro</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/select-into-a-macro-variable-inside-a-macro/m-p/363227#M64599</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a question regarding proc sql select into clause. Here is my code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%macro varinput(data=, selectname= , namelike=);&lt;BR /&gt;proc contents data=&amp;amp;data. out=contents(keep=name) noprint;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;proc sql noprint;&lt;BR /&gt;select name into: &amp;amp;selectname. separated by ' '&lt;BR /&gt;from contents&lt;BR /&gt;where name like "&amp;amp;namelike.";&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;%mend varinput;&lt;BR /&gt;%varinput(data=outcome.cvd, selectname=miad , namelike=v_miad);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My objective is to extract those variables with name containg v_miad. I want to put these variables into a macro variable named miad. However, it seems that &amp;amp;miad cannot be resolved. Does anyone know how to solve this? Thank you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 31 May 2017 21:06:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/select-into-a-macro-variable-inside-a-macro/m-p/363227#M64599</guid>
      <dc:creator>Heraaaa</dc:creator>
      <dc:date>2017-05-31T21:06:20Z</dc:date>
    </item>
    <item>
      <title>Re: select into a macro variable inside a macro</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/select-into-a-macro-variable-inside-a-macro/m-p/363229#M64600</link>
      <description>&lt;P&gt;When SQL creates a new macro variable, it is always a local variable.&amp;nbsp; Add this as the first line inside the macro definition:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%global &amp;amp;selectname;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then SQL will no longer be creating a new macro variable ... it can re-assign a value to the global variable.&lt;/P&gt;</description>
      <pubDate>Wed, 31 May 2017 21:16:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/select-into-a-macro-variable-inside-a-macro/m-p/363229#M64600</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2017-05-31T21:16:58Z</dc:date>
    </item>
    <item>
      <title>Re: select into a macro variable inside a macro</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/select-into-a-macro-variable-inside-a-macro/m-p/363230#M64601</link>
      <description>&lt;P&gt;It worked. Thank you for the quick response!&lt;/P&gt;</description>
      <pubDate>Wed, 31 May 2017 21:23:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/select-into-a-macro-variable-inside-a-macro/m-p/363230#M64601</guid>
      <dc:creator>Heraaaa</dc:creator>
      <dc:date>2017-05-31T21:23:58Z</dc:date>
    </item>
  </channel>
</rss>

