<?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: Macro picking all names of employes in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Macro-picking-all-names-of-employes/m-p/156392#M30561</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You have no FROM clause telling SAS where to select the data from, as well as separated is spelled incorrectly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;proc sql;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;select empname from emp into :names separated by ',' &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;FROM table_name;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;quit;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 06 Feb 2015 06:04:31 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2015-02-06T06:04:31Z</dc:date>
    <item>
      <title>Macro picking all names of employes</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-picking-all-names-of-employes/m-p/156391#M30560</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;I am having a table with column name Empname i want to pick all the empname and create a macr&lt;/P&gt;&lt;P&gt;i tryed by &lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt;select empname from emp into:names separted by ',' ;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;i having the Table all_emp i wnat to picek the employes of emp table in all_emp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Feb 2015 06:00:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-picking-all-names-of-employes/m-p/156391#M30560</guid>
      <dc:creator>sas_Forum</dc:creator>
      <dc:date>2015-02-06T06:00:49Z</dc:date>
    </item>
    <item>
      <title>Re: Macro picking all names of employes</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-picking-all-names-of-employes/m-p/156392#M30561</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You have no FROM clause telling SAS where to select the data from, as well as separated is spelled incorrectly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;proc sql;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;select empname from emp into :names separated by ',' &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;FROM table_name;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;quit;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Feb 2015 06:04:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-picking-all-names-of-employes/m-p/156392#M30561</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-02-06T06:04:31Z</dc:date>
    </item>
    <item>
      <title>Re: Macro picking all names of employes</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-picking-all-names-of-employes/m-p/156393#M30562</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well, you do have a FROM clause, but it is in the wrong place.&amp;nbsp; Technically, it would be moved:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select empname into : names separated by ',' from emp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But take a step back for a moment.&amp;nbsp; Even if you created such a macro variable it wouldn't be useful later.&amp;nbsp; You would get a list like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Amy,Peter,Fred&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What you really would need in order to utilize a macro variable later is a value like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"Amy", "Peter", "Fred"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You could get SQL to produce that instead.&amp;nbsp; But take another step back and you'll see that macro language is the wrong approach for this task.&amp;nbsp; SQL lets you select matching records.&amp;nbsp; My SQL might not be good enough, but there are enough SQL programmers on the board to correct this if necessary:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;select * from all_emp where name in (select name from emp);&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good luck.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Feb 2015 15:06:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-picking-all-names-of-employes/m-p/156393#M30562</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2015-02-06T15:06:35Z</dc:date>
    </item>
  </channel>
</rss>

