<?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: Concatenating variable variables problem in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Concatenating-variable-variables-problem/m-p/190918#M35985</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well, the simplest one which jumps to mind is (assuming sorted):&lt;/P&gt;&lt;P&gt;data want (keep=type newvalue);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; length newvalue $2000;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set have;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; by type;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if first.type then newvalue=value;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else newvalue=strip(newvalue)||","||strip(value);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if last.type then output;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 23 Jul 2014 08:37:00 GMT</pubDate>
    <dc:creator>RW9</dc:creator>
    <dc:date>2014-07-23T08:37:00Z</dc:date>
    <item>
      <title>Concatenating variable variables problem</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Concatenating-variable-variables-problem/m-p/190917#M35984</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm stuck on the following problem. I have a dataset that looks like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Type&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Value&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;animal&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sheep&lt;/P&gt;&lt;P&gt;animal&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dog&lt;/P&gt;&lt;P&gt;animal&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cow&lt;/P&gt;&lt;P&gt;office&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; chair&lt;/P&gt;&lt;P&gt;office&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; table&lt;/P&gt;&lt;P&gt;building&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; skyscraper&lt;/P&gt;&lt;P&gt;building&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; appartment&lt;/P&gt;&lt;P&gt;building&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; flat&lt;/P&gt;&lt;P&gt;building&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; townhouse&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to concatenate the values per type to 1 single string, seperated by a comma and a space (, ). So then I end up with somethinig like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Type&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; NewValue&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;animal&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sheep, dog, cow&lt;/P&gt;&lt;P&gt;office&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; chair, table&lt;/P&gt;&lt;P&gt;building&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; skyscraper, appartment, flat, townhouse&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can transpose this dataset and then concatenate the values together. But the problem is that the number of values per type can vary up to an unknown number. So on one moment in time there could be 4 maximum values per type. On another moment in time there could be 10 values per type.&lt;/P&gt;&lt;P&gt;I figured out I can use ATTRN(NSVARS) to calculate the number of variables/columns that the transpose creates but I can't figure out the syntax mnsto use this number to write it down to something like&lt;/P&gt;&lt;P&gt;catx(', ',&amp;amp;Column1 to &amp;amp;Column&lt;N&gt;) where &lt;N&gt; is the last Column1 is the first column created by the transpose and Column&lt;N&gt; is the last.&lt;/N&gt;&lt;/N&gt;&lt;/N&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anyone have a solution for this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks in advance.,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jul 2014 08:14:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Concatenating-variable-variables-problem/m-p/190917#M35984</guid>
      <dc:creator>Kristiaan</dc:creator>
      <dc:date>2014-07-23T08:14:12Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenating variable variables problem</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Concatenating-variable-variables-problem/m-p/190918#M35985</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well, the simplest one which jumps to mind is (assuming sorted):&lt;/P&gt;&lt;P&gt;data want (keep=type newvalue);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; length newvalue $2000;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set have;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; by type;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if first.type then newvalue=value;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else newvalue=strip(newvalue)||","||strip(value);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if last.type then output;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jul 2014 08:37:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Concatenating-variable-variables-problem/m-p/190918#M35985</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2014-07-23T08:37:00Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenating variable variables problem</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Concatenating-variable-variables-problem/m-p/190919#M35986</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use retaining and by processing in this well ordered dataset. Your questions to solve:&lt;/P&gt;&lt;P&gt;- maximum length of resulting variable&lt;/P&gt;&lt;P&gt;- output processing on last of the by group&lt;/P&gt;&lt;P&gt;- initialisation on first of the by group.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jul 2014 08:40:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Concatenating-variable-variables-problem/m-p/190919#M35986</guid>
      <dc:creator>jakarman</dc:creator>
      <dc:date>2014-07-23T08:40:39Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenating variable variables problem</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Concatenating-variable-variables-problem/m-p/190920#M35987</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You could also use transpose, just create a template dataset with far more variables than ever will happen and then set that with the transpose&amp;nbsp; (do note however that one variable can only hold up to 2000 characters, thereofr if you have lots of data it will not all fit and you will get truncation - also on previous):&lt;/P&gt;&lt;P&gt;data temp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; attrib val1-val2000 format=$200.;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if _n_&amp;lt;0 then output;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;proc transpose data=have out=want prefix=val;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; by type;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set want;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; attrib newvalue format=$2000.;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; newvalue=catx(',',of val1-val2000);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jul 2014 08:41:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Concatenating-variable-variables-problem/m-p/190920#M35987</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2014-07-23T08:41:52Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenating variable variables problem</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Concatenating-variable-variables-problem/m-p/190921#M35988</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How about using a DOW loop?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA HAVE;&lt;/P&gt;&lt;P&gt;INFILE DATALINES;&lt;/P&gt;&lt;P&gt;LENGTH TYPE $8 VALUE $10;&lt;/P&gt;&lt;P&gt;INPUT TYPE $ VALUE $;&lt;/P&gt;&lt;P&gt;DATALINES;&lt;/P&gt;&lt;P&gt;ANIMAL SHEEP&lt;/P&gt;&lt;P&gt;ANIMAL DOG&lt;/P&gt;&lt;P&gt;ANIMAL COW&lt;/P&gt;&lt;P&gt;OFFICE CHAIR&lt;/P&gt;&lt;P&gt;OFFICE TABLE&lt;/P&gt;&lt;P&gt;BUILDING SKYSCRAPER&lt;/P&gt;&lt;P&gt;BUILDING APPARTMENT&lt;/P&gt;&lt;P&gt;BUILDING FLAT&lt;/P&gt;&lt;P&gt;BUILDING TOWNHOUSE&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;RUN;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PROC SORT DATA=HAVE;&lt;/P&gt;&lt;P&gt;BY TYPE;&lt;/P&gt;&lt;P&gt;RUN;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA WANT;&lt;/P&gt;&lt;P&gt;LENGTH VALUE2 $2000;&lt;/P&gt;&lt;P&gt;DO UNTIL (LAST.TYPE);&lt;/P&gt;&lt;P&gt;&amp;nbsp; SET HAVE; &lt;/P&gt;&lt;P&gt;&amp;nbsp; BY TYPE;&lt;/P&gt;&lt;P&gt;&amp;nbsp; VALUE2 = CATX(", ",VALUE2,VALUE);&lt;/P&gt;&lt;P&gt;END;&lt;/P&gt;&lt;P&gt;RUN;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jul 2014 09:33:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Concatenating-variable-variables-problem/m-p/190921#M35988</guid>
      <dc:creator>Scott_Mitchell</dc:creator>
      <dc:date>2014-07-23T09:33:30Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenating variable variables problem</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Concatenating-variable-variables-problem/m-p/190922#M35989</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This seems to do the trick without needing the transpose but why? I'm not familliar with putting a do until statement in front of the set statement. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jul 2014 09:50:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Concatenating-variable-variables-problem/m-p/190922#M35989</guid>
      <dc:creator>Kristiaan</dc:creator>
      <dc:date>2014-07-23T09:50:40Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenating variable variables problem</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Concatenating-variable-variables-problem/m-p/190923#M35990</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This didn't work for me unfortunately.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jul 2014 09:51:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Concatenating-variable-variables-problem/m-p/190923#M35990</guid>
      <dc:creator>Kristiaan</dc:creator>
      <dc:date>2014-07-23T09:51:27Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenating variable variables problem</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Concatenating-variable-variables-problem/m-p/190924#M35991</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry, which post didn't work, what were the errors/warnings?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jul 2014 10:03:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Concatenating-variable-variables-problem/m-p/190924#M35991</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2014-07-23T10:03:55Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenating variable variables problem</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Concatenating-variable-variables-problem/m-p/190925#M35992</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My proposal to programming a retain is more easy to understand. It is sharing the by processing but the retaining is solved different.&lt;/P&gt;&lt;P&gt;The whole trick is based on some definitions with the PDV (program data vector) and the automatic record processing / reinitializing values of recordfields.&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/resources/papers/proceedings12/052-2012.pdf" title="http://support.sas.com/resources/papers/proceedings12/052-2012.pdf"&gt;http://support.sas.com/resources/papers/proceedings12/052-2012.pdf&lt;/A&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Scott Mitchels code can be copied and works great.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jul 2014 10:07:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Concatenating-variable-variables-problem/m-p/190925#M35992</guid>
      <dc:creator>jakarman</dc:creator>
      <dc:date>2014-07-23T10:07:43Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenating variable variables problem</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Concatenating-variable-variables-problem/m-p/190926#M35993</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;DATA HAVE;&lt;/P&gt;&lt;P&gt;INFILE DATALINES;&lt;/P&gt;&lt;P&gt;LENGTH TYPE $8 VALUE $10;&lt;/P&gt;&lt;P&gt;INPUT TYPE $ VALUE $;&lt;/P&gt;&lt;P&gt;DATALINES;&lt;/P&gt;&lt;P&gt;ANIMAL SHEEP&lt;/P&gt;&lt;P&gt;ANIMAL DOG&lt;/P&gt;&lt;P&gt;ANIMAL COW&lt;/P&gt;&lt;P&gt;OFFICE CHAIR&lt;/P&gt;&lt;P&gt;OFFICE TABLE&lt;/P&gt;&lt;P&gt;BUILDING SKYSCRAPER&lt;/P&gt;&lt;P&gt;BUILDING APPARTMENT&lt;/P&gt;&lt;P&gt;BUILDING FLAT&lt;/P&gt;&lt;P&gt;BUILDING TOWNHOUSE&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;RUN;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PROC SORT DATA=HAVE;&lt;/P&gt;&lt;P&gt;BY TYPE;&lt;/P&gt;&lt;P&gt;RUN;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want2 (keep=type newvalue);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; length newvalue $2000;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set have;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; by type;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if first.type then newvalue=value;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else newvalue=strip(newvalue)||","||strip(value);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if last.type then output;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are no errors. But the result looks like this:&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;,COW&lt;/TD&gt;&lt;TD&gt;ANIMAL&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;,TOWNHOUSE&lt;/TD&gt;&lt;TD&gt;BUILDING&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;,TABLE&lt;/TD&gt;&lt;TD&gt;OFFICE&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And I couldn't really figure out how to make it work. So I went with Scott_Mitchell's solution &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jul 2014 10:15:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Concatenating-variable-variables-problem/m-p/190926#M35993</guid>
      <dc:creator>Kristiaan</dc:creator>
      <dc:date>2014-07-23T10:15:08Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenating variable variables problem</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Concatenating-variable-variables-problem/m-p/190927#M35994</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you very much for the link. I will go look into it &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jul 2014 10:16:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Concatenating-variable-variables-problem/m-p/190927#M35994</guid>
      <dc:creator>Kristiaan</dc:creator>
      <dc:date>2014-07-23T10:16:51Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenating variable variables problem</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Concatenating-variable-variables-problem/m-p/190928#M35995</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yep, I forget the retain statement:&lt;/P&gt;&lt;P&gt;data want2 ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; length newvalue $2000;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set have;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; retain newvalue;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; by type;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if first.type then newvalue=value;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else newvalue=strip(newvalue)||","||strip(value);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if last.type then output;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jul 2014 10:35:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Concatenating-variable-variables-problem/m-p/190928#M35995</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2014-07-23T10:35:41Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenating variable variables problem</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Concatenating-variable-variables-problem/m-p/190929#M35996</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ah, there. Now it works yes. I assumed it was a retain and was messing around with it but I put it in the wrong place in your code. Thanks for the help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jul 2014 10:44:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Concatenating-variable-variables-problem/m-p/190929#M35996</guid>
      <dc:creator>Kristiaan</dc:creator>
      <dc:date>2014-07-23T10:44:39Z</dc:date>
    </item>
  </channel>
</rss>

