<?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: SAS SQL and into in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SAS-SQL-and-into/m-p/251070#M47379</link>
    <description>&lt;P&gt;What exactly are you going to do with a macro variable which resolves as:&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;'Bob','alice','Petter'&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I assume your going to use it in either a do loop or an SQL where. &amp;nbsp;Might I suggest a better way of doing it for SQL would be to put your parameters in a dataset and use a where (subclause) sytax, e.g:&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;data params;
  param="Bob"; output;
  param="Alice"; output;
  param="Petter"; output;
run;

proc sql;
  select   * 
  from     HAVE 
  where   NAME in (select PARAM from PARAMS);
quit;&lt;/PRE&gt;</description>
    <pubDate>Fri, 19 Feb 2016 09:46:09 GMT</pubDate>
    <dc:creator>RW9</dc:creator>
    <dc:date>2016-02-19T09:46:09Z</dc:date>
    <item>
      <title>SAS SQL and into</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-SQL-and-into/m-p/250979#M47351</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want by using sql (or by other methode)&amp;nbsp; to create a macro variable like this&lt;/P&gt;
&lt;P&gt;v_name ='Bob','alice','Petter'&lt;/P&gt;
&lt;P&gt;I have tried sql with&lt;/P&gt;
&lt;P&gt;proc sql;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; select&amp;nbsp; distinct name into :v_name sparated by '',''&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; from dbase;&lt;/P&gt;
&lt;P&gt;quit;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I will get&amp;nbsp; name= Bob','alice','Petter, but I want to get name= 'Bob','alice','Petter'&lt;/P&gt;
&lt;P&gt;Thank you&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Feb 2016 22:52:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-SQL-and-into/m-p/250979#M47351</guid>
      <dc:creator>LineMoon</dc:creator>
      <dc:date>2016-02-18T22:52:28Z</dc:date>
    </item>
    <item>
      <title>Re: SAS SQL and into</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-SQL-and-into/m-p/250980#M47352</link>
      <description>&lt;P&gt;Use the QUOTE() function and separated by space.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
  select  distinct quote(name) into :v_name separated by ", "
    from dbase;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 18 Feb 2016 22:57:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-SQL-and-into/m-p/250980#M47352</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-02-18T22:57:34Z</dc:date>
    </item>
    <item>
      <title>Re: SAS SQL and into</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-SQL-and-into/m-p/251070#M47379</link>
      <description>&lt;P&gt;What exactly are you going to do with a macro variable which resolves as:&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;'Bob','alice','Petter'&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I assume your going to use it in either a do loop or an SQL where. &amp;nbsp;Might I suggest a better way of doing it for SQL would be to put your parameters in a dataset and use a where (subclause) sytax, e.g:&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;data params;
  param="Bob"; output;
  param="Alice"; output;
  param="Petter"; output;
run;

proc sql;
  select   * 
  from     HAVE 
  where   NAME in (select PARAM from PARAMS);
quit;&lt;/PRE&gt;</description>
      <pubDate>Fri, 19 Feb 2016 09:46:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-SQL-and-into/m-p/251070#M47379</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-02-19T09:46:09Z</dc:date>
    </item>
    <item>
      <title>Re: SAS SQL and into</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-SQL-and-into/m-p/251274#M47440</link>
      <description>&lt;P&gt;Thank you for your answer.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Feb 2016 20:36:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-SQL-and-into/m-p/251274#M47440</guid>
      <dc:creator>LineMoon</dc:creator>
      <dc:date>2016-02-19T20:36:25Z</dc:date>
    </item>
    <item>
      <title>Re: SAS SQL and into</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-SQL-and-into/m-p/251278#M47442</link>
      <description>&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Fri, 19 Feb 2016 20:39:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-SQL-and-into/m-p/251278#M47442</guid>
      <dc:creator>LineMoon</dc:creator>
      <dc:date>2016-02-19T20:39:49Z</dc:date>
    </item>
  </channel>
</rss>

