<?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: Concatenate vertically in macrovariable in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Concatenate-vertically-in-macrovariable/m-p/372156#M88938</link>
    <description>&lt;P&gt;Thanks for the answer art297.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But I get another error then...&lt;/P&gt;&lt;P&gt;Doing this it returns '1','5','13' which is a good answer, but ...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;NOTE: Line generated by the macro variable "namelist".
148        '1','5','13'
           _
           22
            _
            76

ERROR 22-322: Syntax error, expecting one of the following: a quoted string, a numeric constant, a datetime constant, 
              a missing value, (, -, SELECT.  
ERROR 76-322: Syntax error, statement will be ignored.&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 30 Jun 2017 13:50:05 GMT</pubDate>
    <dc:creator>Planck</dc:creator>
    <dc:date>2017-06-30T13:50:05Z</dc:date>
    <item>
      <title>Concatenate vertically in macrovariable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Concatenate-vertically-in-macrovariable/m-p/371849#M88831</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;%macro extraction;

%LET A = '(' ;

data _null_;
set tableT ;
where B = "B1" and C IN ('C1','C2','C3');
&amp;amp;A. = &amp;amp;A. || ',';
run;

&amp;amp;A. = &amp;amp;A. || ')';


%mend;

%extraction;&lt;/PRE&gt;&lt;P&gt;I have this code with several error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I try to concatenate all D column values of the result of my datastep in a macro variable named A in this way:&lt;/P&gt;&lt;P&gt;"(&lt;EM&gt;D_firstrow&lt;/EM&gt;, &lt;EM&gt;D_secondrow&lt;/EM&gt;, ..., &lt;EM&gt;D_nthrow&lt;/EM&gt;)"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for help&lt;/P&gt;</description>
      <pubDate>Thu, 29 Jun 2017 18:14:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Concatenate-vertically-in-macrovariable/m-p/371849#M88831</guid>
      <dc:creator>Planck</dc:creator>
      <dc:date>2017-06-29T18:14:16Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenate vertically in macrovariable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Concatenate-vertically-in-macrovariable/m-p/371851#M88832</link>
      <description>&lt;P&gt;Can you explain what you're trying to do? Is there any reason the SQL version isn't being used, it's much easier?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
select name into :name_list separated by ", "
from sashelp.class;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 29 Jun 2017 18:18:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Concatenate-vertically-in-macrovariable/m-p/371851#M88832</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-06-29T18:18:51Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenate vertically in macrovariable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Concatenate-vertically-in-macrovariable/m-p/371852#M88833</link>
      <description>&lt;P&gt;I think you are asking for the SELECT ... INTO functionality of PROC SQL.&lt;/P&gt;
&lt;P&gt;Try running this example:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql noprint;
  select quote(trim(name)) into :namelist separate by ' '
  from sashelp.class
  where age =13
  ;
quit;
%put &amp;amp;=namelist;
proc print data=sashelp.class ;
 where name in (&amp;amp;namelist);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 29 Jun 2017 18:20:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Concatenate-vertically-in-macrovariable/m-p/371852#M88833</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2017-06-29T18:20:08Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenate vertically in macrovariable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Concatenate-vertically-in-macrovariable/m-p/371870#M88836</link>
      <description>&lt;P&gt;One minor correction to&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt;'s code. Surely he meant separtated rather than separate.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Jun 2017 19:16:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Concatenate-vertically-in-macrovariable/m-p/371870#M88836</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2017-06-29T19:16:43Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenate vertically in macrovariable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Concatenate-vertically-in-macrovariable/m-p/371881#M88841</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13711"&gt;@art297&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;One minor correction to&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt;'s code. Surely he meant separtated rather than separate.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Thanks. &amp;nbsp;Note that SAS auto-corrected it so it actually ran.&lt;/P&gt;
&lt;PRE&gt;97   proc sql noprint;
98     select quote(trim(name)) into :namelist separate by ' '
                                               --------
                                               1
WARNING 1-322: Assuming the symbol SEPARATED was misspelled as separate.

99     from sashelp.class
100    where age =13
101    ;
102  quit;
NOTE: PROCEDURE SQL used (Total process time):&lt;/PRE&gt;</description>
      <pubDate>Thu, 29 Jun 2017 19:45:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Concatenate-vertically-in-macrovariable/m-p/371881#M88841</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2017-06-29T19:45:30Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenate vertically in macrovariable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Concatenate-vertically-in-macrovariable/m-p/372110#M88917</link>
      <description>&lt;P&gt;Thanks Tom,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It worked well.&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Jun 2017 11:46:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Concatenate-vertically-in-macrovariable/m-p/372110#M88917</guid>
      <dc:creator>Planck</dc:creator>
      <dc:date>2017-06-30T11:46:54Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenate vertically in macrovariable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Concatenate-vertically-in-macrovariable/m-p/372136#M88928</link>
      <description>&lt;P&gt;I answered too quickly, it is not working &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I took back your example:&lt;/P&gt;&lt;PRE&gt;proc sql noprint;
  select quote(trim(name)) into :namelist separated by "','"
  from sashelp.class
  where age =13
  ;
quit;
%put &amp;amp;=namelist;
proc print data=sashelp.class ;
 where name in ('&amp;amp;namelist.');
run;&lt;/PRE&gt;&lt;P&gt;I modified the separation string because it is character.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to have " '01','02','03' " and not "1 2 3"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I create the macrovariable namelist with value " 01','02','03 &amp;nbsp;" and then I call ('&amp;amp;namelist.') to get " ('01','02','03') " but thers should be something wrong because it returns no result in the new table, whereas when I write ('01','02','03') manually i have some results.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PS: when I write&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;%put &amp;amp;namelist.&lt;/PRE&gt;&lt;P&gt;I get 01','02','03&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;which is the expected result.&lt;/P&gt;&lt;P&gt;Can you help me for this?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 30 Jun 2017 12:57:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Concatenate-vertically-in-macrovariable/m-p/372136#M88928</guid>
      <dc:creator>Planck</dc:creator>
      <dc:date>2017-06-30T12:57:54Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenate vertically in macrovariable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Concatenate-vertically-in-macrovariable/m-p/372141#M88929</link>
      <description>&lt;P&gt;This type of syntax works fine in SAS code.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;where name in ("Alfred" "Beth" "Nancy")&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;There is no need to use single quotes instead of double quotes and no need to add commas between the values instead of spaces.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What are you using the list of values for? &amp;nbsp;If you are trying to generated a comma separated list of values quoted using single quote characters so that you use the value in some pass thru SQL to a database that is not as friendly to code in then your query will need to work a little harder.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You could first add the single quotes and commas using the SEPARATED BY clause&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;select name into :list separated by "','"&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;But then you need to add the beginning and ending single quotes, which can get tricky. &amp;nbsp;You should be able to use the %BQUOTE() macro function which will let you expand the macro variable inside of single quotes, but you would also want to add the %UNQUOTE() macro function to remove the macro quoting that %BQUOTE() will add.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let list=%unquote(%bquote('&amp;amp;list'));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Note that method will have problems if your data step variable could contain actual single quote characters. For example O'Hara could be valid NAME value. &amp;nbsp;In that case perhaps it is better to have SAS functions add the quotes and not use macro coding to do that.&lt;/STRONG&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;select quote(trim(name),"'") into :list separated by ','&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Now that you have your single quoted comma separated list in a IN () operation.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;where name in (&amp;amp;list)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Or perhaps in a DO loop in a data step where the commas are needed.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;do name = &amp;amp;list ;
   output;
end;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Jun 2017 13:20:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Concatenate-vertically-in-macrovariable/m-p/372141#M88929</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2017-06-30T13:20:56Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenate vertically in macrovariable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Concatenate-vertically-in-macrovariable/m-p/372144#M88930</link>
      <description>&lt;P&gt;If you need single quotes, separated by commas, you could use:&lt;/P&gt;
&lt;PRE&gt;proc sql noprint;
  select catt("'",(trim(name)),"'") into :namelist separated by ','
  from sashelp.class
  where age =13
  ;
quit;
%put &amp;amp;namelist;
proc print data=sashelp.class ;
 where name in (&amp;amp;namelist);
run;
&lt;/PRE&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Jun 2017 13:18:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Concatenate-vertically-in-macrovariable/m-p/372144#M88930</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2017-06-30T13:18:04Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenate vertically in macrovariable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Concatenate-vertically-in-macrovariable/m-p/372145#M88931</link>
      <description>&lt;P&gt;Oh ok thanks for answer,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am used to put some commas. But even, when I try your method i get an error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The first query works well. I get the result: 1 5 13&lt;/P&gt;&lt;P&gt;But after when I run the second query so I have:&lt;/P&gt;&lt;PRE&gt;WHERE &lt;EM&gt;mydata&lt;/EM&gt; IN (1 5 13)&lt;/PRE&gt;&lt;P&gt;And I get the error:&lt;/P&gt;&lt;PRE&gt;ERROR: Expression using IN has components that are of different data types.&lt;/PRE&gt;&lt;P&gt;because mydata is character.&lt;/P&gt;</description>
      <pubDate>Fri, 30 Jun 2017 13:20:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Concatenate-vertically-in-macrovariable/m-p/372145#M88931</guid>
      <dc:creator>Planck</dc:creator>
      <dc:date>2017-06-30T13:20:32Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenate vertically in macrovariable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Concatenate-vertically-in-macrovariable/m-p/372146#M88932</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Proc sql noprint;
Select quote(name, "'") into :name_list separated by ', ' from SASHELP.class;
Quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 30 Jun 2017 13:20:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Concatenate-vertically-in-macrovariable/m-p/372146#M88932</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-06-30T13:20:37Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenate vertically in macrovariable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Concatenate-vertically-in-macrovariable/m-p/372147#M88933</link>
      <description>&lt;P&gt;If your data is character you need the quotes.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Jun 2017 13:21:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Concatenate-vertically-in-macrovariable/m-p/372147#M88933</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-06-30T13:21:54Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenate vertically in macrovariable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Concatenate-vertically-in-macrovariable/m-p/372148#M88934</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/121074"&gt;@Planck&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Oh ok thanks for answer,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am used to put some commas. But even, when I try your method i get an error.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The first query works well. I get the result: 1 5 13&lt;/P&gt;
&lt;P&gt;But after when I run the second query so I have:&lt;/P&gt;
&lt;PRE&gt;WHERE &lt;EM&gt;mydata&lt;/EM&gt; IN (1 5 13)&lt;/PRE&gt;
&lt;P&gt;And I get the error:&lt;/P&gt;
&lt;PRE&gt;ERROR: Expression using IN has components that are of different data types.&lt;/PRE&gt;
&lt;P&gt;because mydata is character.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;The error message explains the problem. &amp;nbsp;You cannot use numeric literals in the IN list if the variable being compared is character. You need to use character literals.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;WHERE mydata IN ("1" "5" "13")&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 30 Jun 2017 13:22:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Concatenate-vertically-in-macrovariable/m-p/372148#M88934</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2017-06-30T13:22:59Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenate vertically in macrovariable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Concatenate-vertically-in-macrovariable/m-p/372156#M88938</link>
      <description>&lt;P&gt;Thanks for the answer art297.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But I get another error then...&lt;/P&gt;&lt;P&gt;Doing this it returns '1','5','13' which is a good answer, but ...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;NOTE: Line generated by the macro variable "namelist".
148        '1','5','13'
           _
           22
            _
            76

ERROR 22-322: Syntax error, expecting one of the following: a quoted string, a numeric constant, a datetime constant, 
              a missing value, (, -, SELECT.  
ERROR 76-322: Syntax error, statement will be ignored.&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Jun 2017 13:50:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Concatenate-vertically-in-macrovariable/m-p/372156#M88938</guid>
      <dc:creator>Planck</dc:creator>
      <dc:date>2017-06-30T13:50:05Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenate vertically in macrovariable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Concatenate-vertically-in-macrovariable/m-p/372166#M88942</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/121074"&gt;@Planck&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Thanks for the answer art297.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But I get another error then...&lt;/P&gt;
&lt;P&gt;Doing this it returns '1','5','13' which is a good answer, but ...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;NOTE: Line generated by the macro variable "namelist".
148        '1','5','13'
           _
           22
            _
            76

ERROR 22-322: Syntax error, expecting one of the following: a quoted string, a numeric constant, a datetime constant, 
              a missing value, (, -, SELECT.  
ERROR 76-322: Syntax error, statement will be ignored.&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You have not provided enough context to evaluate the cause of the error.&lt;/P&gt;
&lt;P&gt;Most likely you have ommited the () in trying to use the IN operator.&lt;/P&gt;</description>
      <pubDate>Fri, 30 Jun 2017 14:03:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Concatenate-vertically-in-macrovariable/m-p/372166#M88942</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2017-06-30T14:03:47Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenate vertically in macrovariable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Concatenate-vertically-in-macrovariable/m-p/372175#M88943</link>
      <description>&lt;P&gt;I checked this but no. What is strange is when I replace manually&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;WHERE mydata IN (&amp;amp;namelist.)&lt;/PRE&gt;&lt;P&gt;by&lt;/P&gt;&lt;PRE&gt;WHERE mydata IN ('1','5','13')&lt;/PRE&gt;&lt;P&gt;It works...&lt;/P&gt;&lt;P&gt;That's annonying a bit ^^&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But when it is &amp;amp;namelist. it keeps telling me this error when trying to replace the value in PROC SQL&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Jun 2017 14:11:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Concatenate-vertically-in-macrovariable/m-p/372175#M88943</guid>
      <dc:creator>Planck</dc:creator>
      <dc:date>2017-06-30T14:11:05Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenate vertically in macrovariable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Concatenate-vertically-in-macrovariable/m-p/372177#M88944</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/121074"&gt;@Planck&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;I checked this but no. What is strange is when I replace manually&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;WHERE mydata IN (&amp;amp;namelist.)&lt;/PRE&gt;
&lt;P&gt;by&lt;/P&gt;
&lt;PRE&gt;WHERE mydata IN ('1','5','13')&lt;/PRE&gt;
&lt;P&gt;It works...&lt;/P&gt;
&lt;P&gt;That's annonying a bit ^^&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But when it is &amp;amp;namelist. it keeps telling me this error when trying to replace the value in PROC SQL&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Most likely your macro variable has macro quoting and it is confusing the SAS compiler. &amp;nbsp;Try removing the macro quoting.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;where mydata in ( %unquote(&amp;amp;namelist) )&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 30 Jun 2017 14:15:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Concatenate-vertically-in-macrovariable/m-p/372177#M88944</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2017-06-30T14:15:59Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenate vertically in macrovariable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Concatenate-vertically-in-macrovariable/m-p/372196#M88948</link>
      <description>&lt;P&gt;It was exactly the solution.&lt;/P&gt;&lt;P&gt;Thanks so much Tom! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Jun 2017 14:44:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Concatenate-vertically-in-macrovariable/m-p/372196#M88948</guid>
      <dc:creator>Planck</dc:creator>
      <dc:date>2017-06-30T14:44:18Z</dc:date>
    </item>
  </channel>
</rss>

