<?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 observation using proc sql in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/concatenate-observation-using-proc-sql/m-p/281458#M57084</link>
    <description>&lt;P&gt;Dear Reza,&lt;/P&gt;&lt;P&gt;thanks for your moral support but I am not frustrated, I happy to work with SAS. The scope of my job is not playing/learning SAS for fun, but to do what I need helped by SAS. Therefore I wanna do it in a for me understandable and fast manner, this is way I am using the forum. With the time I will be a bit more SAS friendly.&lt;/P&gt;&lt;P&gt;Unfortunately I cannot use r and Python or Apache Spark (where you have all together Python, r, sql, django....) and IML due to legal constrains. Based on my understanding you do not offer r or Python inside SAS (like for sql) but I would need to install separately r and Python.&lt;/P&gt;</description>
    <pubDate>Thu, 30 Jun 2016 14:57:14 GMT</pubDate>
    <dc:creator>Sir_Highbury</dc:creator>
    <dc:date>2016-06-30T14:57:14Z</dc:date>
    <item>
      <title>concatenate observation using proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/concatenate-observation-using-proc-sql/m-p/281429#M57072</link>
      <description>&lt;PRE&gt;Dear expert,&lt;U&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/U&gt;considering the initial data set:&lt;BR /&gt;&lt;EM&gt;&lt;BR /&gt;data have;
  country="BU"; output;
  country="JA"; output;
  country="US"; output;
run;&lt;/EM&gt;&lt;BR /&gt;&lt;BR /&gt;Considering the following code that already works:
&lt;BR /&gt;&lt;EM&gt;data want (drop=country rename=(tmp=country));
  length tmp $2000;
  set have end=last;
  retain tmp;
  tmp=catx(",",tmp,country);
  if last then output;
run;&lt;BR /&gt;&lt;BR /&gt;&lt;/EM&gt;is there another short way of doing it, maybe using the proc sql? Thanks, SH&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jun 2016 13:35:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/concatenate-observation-using-proc-sql/m-p/281429#M57072</guid>
      <dc:creator>Sir_Highbury</dc:creator>
      <dc:date>2016-06-30T13:35:59Z</dc:date>
    </item>
    <item>
      <title>Re: concatenate observation using proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/concatenate-observation-using-proc-sql/m-p/281433#M57073</link>
      <description>&lt;P&gt;Not via SQL unless your trying to create a macro variable?&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jun 2016 13:46:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/concatenate-observation-using-proc-sql/m-p/281433#M57073</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-06-30T13:46:23Z</dc:date>
    </item>
    <item>
      <title>Re: concatenate observation using proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/concatenate-observation-using-proc-sql/m-p/281437#M57077</link>
      <description>&lt;P&gt;Using a macro variable as intermediate storage:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql noprint;
select country into :country separated by ','
from have;
create table want (country char(2000));
insert into want values("&amp;amp;country");
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 30 Jun 2016 13:56:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/concatenate-observation-using-proc-sql/m-p/281437#M57077</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-06-30T13:56:49Z</dc:date>
    </item>
    <item>
      <title>Re: concatenate observation using proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/concatenate-observation-using-proc-sql/m-p/281443#M57079</link>
      <description>&lt;P&gt;I'm going to comment on something, feel free to ignore this.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;From your previous questions it sounds like your moving to SAS from a different language and trying to replicate some sort of process or at least that method of working. It also sounds like your either frustrated or angry at this. SAS works differently, but has its own efficiencies, with the things like _numeric_, variable lists, supporting prefix shortcuts and BY group processing. If you try to use SAS, the SAS way, versus trying to cram it into the R/Python way it will be easier in the long run. If you do want to use R/Python methods, IML may be worth investigating.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My nickel of thought. Good Luck.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jun 2016 14:04:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/concatenate-observation-using-proc-sql/m-p/281443#M57079</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-06-30T14:04:53Z</dc:date>
    </item>
    <item>
      <title>Re: concatenate observation using proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/concatenate-observation-using-proc-sql/m-p/281458#M57084</link>
      <description>&lt;P&gt;Dear Reza,&lt;/P&gt;&lt;P&gt;thanks for your moral support but I am not frustrated, I happy to work with SAS. The scope of my job is not playing/learning SAS for fun, but to do what I need helped by SAS. Therefore I wanna do it in a for me understandable and fast manner, this is way I am using the forum. With the time I will be a bit more SAS friendly.&lt;/P&gt;&lt;P&gt;Unfortunately I cannot use r and Python or Apache Spark (where you have all together Python, r, sql, django....) and IML due to legal constrains. Based on my understanding you do not offer r or Python inside SAS (like for sql) but I would need to install separately r and Python.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jun 2016 14:57:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/concatenate-observation-using-proc-sql/m-p/281458#M57084</guid>
      <dc:creator>Sir_Highbury</dc:creator>
      <dc:date>2016-06-30T14:57:14Z</dc:date>
    </item>
    <item>
      <title>Re: concatenate observation using proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/concatenate-observation-using-proc-sql/m-p/281465#M57090</link>
      <description>&lt;P&gt;Another comment: to learn python/r there are online thousend of courses offered for free online by top universities (e.g. MIT, Berkley).&lt;/P&gt;&lt;P&gt;Despite of paying the SAS licence, you even ask more money (SAS courses are really expensive) to the people that already pay for the licence and are using SAS. This is your business model, I am not willing to pay also for expensive courses. I am one of the thousends of students in Germany that used Python and r for free and fully satisfied.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jun 2016 15:06:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/concatenate-observation-using-proc-sql/m-p/281465#M57090</guid>
      <dc:creator>Sir_Highbury</dc:creator>
      <dc:date>2016-06-30T15:06:45Z</dc:date>
    </item>
    <item>
      <title>Re: concatenate observation using proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/concatenate-observation-using-proc-sql/m-p/281468#M57091</link>
      <description>&lt;P&gt;Tutorials and 2 e-courses for free&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/training/tutorial/index.html" target="_blank"&gt;http://support.sas.com/training/tutorial/index.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Search any topic here - if you can't find a paper that would be surprising&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.lexjansen.com" target="_blank"&gt;http://www.lexjansen.com&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Commercial software does have different training models, this is more in line with Tableau or SPSS.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SAS UE provides SAS software for free to anyone interested in learning. It's a step forward for a company as old as SAS.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jun 2016 15:14:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/concatenate-observation-using-proc-sql/m-p/281468#M57091</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-06-30T15:14:54Z</dc:date>
    </item>
    <item>
      <title>Re: concatenate observation using proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/concatenate-observation-using-proc-sql/m-p/281472#M57092</link>
      <description>&lt;P&gt;do you mean that I can install SAS at home on my PC? Thanks for the links, I will have a closer look. I never used Tableu or SPSS.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jun 2016 15:20:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/concatenate-observation-using-proc-sql/m-p/281472#M57092</guid>
      <dc:creator>Sir_Highbury</dc:creator>
      <dc:date>2016-06-30T15:20:28Z</dc:date>
    </item>
    <item>
      <title>Re: concatenate observation using proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/concatenate-observation-using-proc-sql/m-p/281473#M57093</link>
      <description>&lt;P&gt;&lt;A href="http://www.sas.com/en_us/learn/analytics-u.html" target="_blank"&gt;http://www.sas.com/en_us/learn/analytics-u.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Yes, You can install on SAS on your home PC, run off AWS, or use a install that runs of NC via Academics On Demand. Limitations are for non commercial usage. Research is allowed.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jun 2016 15:24:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/concatenate-observation-using-proc-sql/m-p/281473#M57093</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-06-30T15:24:09Z</dc:date>
    </item>
    <item>
      <title>Re: concatenate observation using proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/concatenate-observation-using-proc-sql/m-p/281480#M57095</link>
      <description>&lt;P&gt;sounds good... I will surely try to benefit from these resources.&lt;/P&gt;&lt;P&gt;When I asked your company for learning possibilities, I got ONLY a list of expensive courses. Nobody mentioned to me it. The question is why? I can imagine an answer &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jun 2016 15:33:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/concatenate-observation-using-proc-sql/m-p/281480#M57095</guid>
      <dc:creator>Sir_Highbury</dc:creator>
      <dc:date>2016-06-30T15:33:36Z</dc:date>
    </item>
    <item>
      <title>Re: concatenate observation using proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/concatenate-observation-using-proc-sql/m-p/281483#M57096</link>
      <description>&lt;P&gt;It's not my company, I'm a SAS user, like yourself. I also program in several other languages, but SAS is my primary language.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jun 2016 15:43:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/concatenate-observation-using-proc-sql/m-p/281483#M57096</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-06-30T15:43:46Z</dc:date>
    </item>
    <item>
      <title>Re: concatenate observation using proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/concatenate-observation-using-proc-sql/m-p/281984#M57246</link>
      <description>&lt;P&gt;if SAS is not your company but you are working for a different one, just for the sake of curiositiy, why do you participate to this forum answering? I would expect it only on "free projects" like linux forum or stack overflow.&lt;/P&gt;</description>
      <pubDate>Mon, 04 Jul 2016 12:50:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/concatenate-observation-using-proc-sql/m-p/281984#M57246</guid>
      <dc:creator>Sir_Highbury</dc:creator>
      <dc:date>2016-07-04T12:50:05Z</dc:date>
    </item>
    <item>
      <title>Re: concatenate observation using proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/concatenate-observation-using-proc-sql/m-p/281986#M57248</link>
      <description>&lt;P&gt;Lol.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There are many community forums that exist for proprietary softwares that predate SO. Remember SO was only invented in 2008, SAS has been around since 1970's. I've been using a SAS forum of some sort since 2005.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is is a free forum for users and contributors. The fact that SAS maintains it is irrelevant except to show their dedication to their user base.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Other examples of proprietary software user groups are Tableau and MS SQL.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In my experience these user groups flourish when they have dedicated staff attached to them. The R user group in the cities I lived in by comparison didn't meet regularly or do much.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Why would volunteering on SO or here be any different? The SAS user base here is much larger and if a question isn't answered SAS will try to answer it. If no one on SO answers your question your pretty much out of luck.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Jul 2016 12:56:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/concatenate-observation-using-proc-sql/m-p/281986#M57248</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-07-04T12:56:33Z</dc:date>
    </item>
    <item>
      <title>Re: concatenate observation using proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/concatenate-observation-using-proc-sql/m-p/281996#M57252</link>
      <description>it was just a question, I did not have any particular expectations. You&lt;BR /&gt;could be a philanthropy or a sas consultant looking for clients or&lt;BR /&gt;whatever. Nothing against any motivation,&lt;BR /&gt;&lt;BR /&gt;##- Please type your reply above this line. Simple formatting, no&lt;BR /&gt;attachments. -##</description>
      <pubDate>Mon, 04 Jul 2016 13:35:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/concatenate-observation-using-proc-sql/m-p/281996#M57252</guid>
      <dc:creator>Sir_Highbury</dc:creator>
      <dc:date>2016-07-04T13:35:02Z</dc:date>
    </item>
    <item>
      <title>Re: concatenate observation using proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/concatenate-observation-using-proc-sql/m-p/282001#M57254</link>
      <description>&lt;PRE&gt;&lt;EM&gt;assuming you would do the same within a macro:&lt;BR /&gt;&lt;BR /&gt;data want (drop=country rename=(tmp=country));
  length tmp $2000;
  set have end=last;
  retain tmp;
  tmp=catx(",",tmp,country);
  if last then output;
run;&lt;BR /&gt;&lt;BR /&gt;I changed the code as it follows:&lt;BR /&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;EM&gt;data want (drop=&amp;amp;var. rename=(tmp=&amp;amp;var.));
  length tmp $2000;
  set have end=last;
  retain tmp;
  tmp=catx(",",tmp,&amp;amp;var.);
  if last then output;
run;&lt;BR /&gt;&lt;BR /&gt;do you already notice a mistake? Instead of getting the value list I get the variable name....&lt;/EM&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;EM&gt;&amp;nbsp;&lt;/EM&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Jul 2016 14:19:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/concatenate-observation-using-proc-sql/m-p/282001#M57254</guid>
      <dc:creator>Sir_Highbury</dc:creator>
      <dc:date>2016-07-04T14:19:29Z</dc:date>
    </item>
    <item>
      <title>Re: concatenate observation using proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/concatenate-observation-using-proc-sql/m-p/282009#M57257</link>
      <description>&lt;P&gt;What does &amp;amp;avatar resolve to? And what are you getting?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I don't see any issues with the code.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PS. I didn't mean any offence with previous response &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Jul 2016 14:29:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/concatenate-observation-using-proc-sql/m-p/282009#M57257</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-07-04T14:29:56Z</dc:date>
    </item>
    <item>
      <title>Re: concatenate observation using proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/concatenate-observation-using-proc-sql/m-p/282012#M57258</link>
      <description>&lt;P&gt;1. I have a macro which is based on the variable &amp;amp;var;&lt;/P&gt;&lt;P&gt;2. A call execute is used;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If for istance the &amp;amp;var assume the variable&amp;nbsp;"segment", I did not get as output the values assumed by the variable "segment" but only the name of the variable "segment" itself.&lt;/P&gt;&lt;P&gt;The example works perfectly, but when I switched to the macro I did something wrong.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Jul 2016 14:47:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/concatenate-observation-using-proc-sql/m-p/282012#M57258</guid>
      <dc:creator>Sir_Highbury</dc:creator>
      <dc:date>2016-07-04T14:47:44Z</dc:date>
    </item>
    <item>
      <title>Re: concatenate observation using proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/concatenate-observation-using-proc-sql/m-p/282014#M57259</link>
      <description>&lt;P&gt;I don't have enough info to help.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think ink this may warrant a new question now, with more details. Usually with call execute it becomes an issue of timing - when it executes versus values that are passed.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Jul 2016 14:54:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/concatenate-observation-using-proc-sql/m-p/282014#M57259</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-07-04T14:54:04Z</dc:date>
    </item>
    <item>
      <title>Re: concatenate observation using proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/concatenate-observation-using-proc-sql/m-p/282016#M57260</link>
      <description>&lt;P&gt;ok, fair enough. I will keep trying and in case I will post something new.&lt;/P&gt;</description>
      <pubDate>Mon, 04 Jul 2016 15:00:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/concatenate-observation-using-proc-sql/m-p/282016#M57260</guid>
      <dc:creator>Sir_Highbury</dc:creator>
      <dc:date>2016-07-04T15:00:10Z</dc:date>
    </item>
    <item>
      <title>Re: concatenate observation using proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/concatenate-observation-using-proc-sql/m-p/282017#M57261</link>
      <description>&lt;P&gt;&lt;SPAN&gt;If you want to use the macro variable to refer to a variable then it needs to contain the NAME of the variable.&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let var=segment;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;From the symptom it looks like you have set the macro variable to a value that includes quotes.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let var="segment";&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This will be interpreted by regular SAS as a string literal and not the name of a variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Jul 2016 15:02:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/concatenate-observation-using-proc-sql/m-p/282017#M57261</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2016-07-04T15:02:14Z</dc:date>
    </item>
  </channel>
</rss>

