<?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 in SAS Studio</title>
    <link>https://communities.sas.com/t5/SAS-Studio/macro/m-p/338183#M2010</link>
    <description>&lt;P&gt;When you say all values of a row do you mean the values in a row or column?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If a column, look at PROC SQL documentation on calculating macro variables.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If a row, try CATX(', ', of _all_);&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 04 Mar 2017 22:56:24 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2017-03-04T22:56:24Z</dc:date>
    <item>
      <title>macro</title>
      <link>https://communities.sas.com/t5/SAS-Studio/macro/m-p/338172#M2008</link>
      <description>&lt;P&gt;I am trying to write a macro to concatenate all values of a row. But its not working. can some one point out? Without the macro its working fine.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%macro dummy(var=);&lt;BR /&gt;proc sql;&lt;BR /&gt;create table values as select distinct(&amp;amp;var.) as vals from td;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;data values1;&lt;BR /&gt;length new_val $100.;&lt;BR /&gt;%do %until(eof);&lt;BR /&gt;set values end=eof;&lt;BR /&gt;new_val=catx("",new_val,vals);&lt;BR /&gt;%end;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;proc print data=values1;&lt;BR /&gt;run;&lt;BR /&gt;%mend;&lt;BR /&gt;%dummy(var=job);&lt;/P&gt;</description>
      <pubDate>Sat, 04 Mar 2017 22:10:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/macro/m-p/338172#M2008</guid>
      <dc:creator>pri2</dc:creator>
      <dc:date>2017-03-04T22:10:17Z</dc:date>
    </item>
    <item>
      <title>Re: macro</title>
      <link>https://communities.sas.com/t5/SAS-Studio/macro/m-p/338183#M2010</link>
      <description>&lt;P&gt;When you say all values of a row do you mean the values in a row or column?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If a column, look at PROC SQL documentation on calculating macro variables.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If a row, try CATX(', ', of _all_);&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 04 Mar 2017 22:56:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/macro/m-p/338183#M2010</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-03-04T22:56:24Z</dc:date>
    </item>
    <item>
      <title>Re: macro</title>
      <link>https://communities.sas.com/t5/SAS-Studio/macro/m-p/338193#M2011</link>
      <description>I meant all values of the column..it is not able to get the value of Eof</description>
      <pubDate>Sun, 05 Mar 2017 00:36:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/macro/m-p/338193#M2011</guid>
      <dc:creator>pri2</dc:creator>
      <dc:date>2017-03-05T00:36:12Z</dc:date>
    </item>
    <item>
      <title>Re: macro</title>
      <link>https://communities.sas.com/t5/SAS-Studio/macro/m-p/338194#M2012</link>
      <description>&lt;P&gt;Yes, macro language doesn't understand DATA step variables such as eof.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You seem to understand the right tools, why not use them:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc sql;&lt;/P&gt;
&lt;P&gt;select strip(var) into : vals&amp;nbsp;separated by ',';&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or possible (but different):&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;select distinct strip(var) into : vals separated by ',';&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you really want this as a DATA step variable (although it is difficult to envision why), you could use:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data test;&lt;/P&gt;
&lt;P&gt;longvar&amp;nbsp;= "&amp;amp;vals";&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;</description>
      <pubDate>Sun, 05 Mar 2017 00:56:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/macro/m-p/338194#M2012</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2017-03-05T00:56:20Z</dc:date>
    </item>
  </channel>
</rss>

