<?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 concatenate last observation variable  value in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/concatenate-last-observation-variable-value/m-p/420054#M103336</link>
    <description>&lt;P&gt;data new4;&lt;BR /&gt;infile datalines missover ;&lt;BR /&gt;input x y $ z $;&lt;BR /&gt;datalines;&lt;BR /&gt;1 a b&lt;BR /&gt;1 a c&lt;BR /&gt;2 b c&lt;BR /&gt;2 b d&lt;BR /&gt;3 r t&lt;BR /&gt;3 r y&lt;BR /&gt;;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;I want my output to be&lt;BR /&gt;A new column need to be generated ICD whose value will be&lt;BR /&gt;x y ICD&lt;BR /&gt;1 a b, c&lt;BR /&gt;2 b c,d&lt;BR /&gt;3 r t,y&lt;BR /&gt;&lt;BR /&gt;I need this output through &lt;STRONG&gt;proc sql &lt;/STRONG&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 11 Dec 2017 10:37:59 GMT</pubDate>
    <dc:creator>Rohit12</dc:creator>
    <dc:date>2017-12-11T10:37:59Z</dc:date>
    <item>
      <title>concatenate last observation variable  value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/concatenate-last-observation-variable-value/m-p/420054#M103336</link>
      <description>&lt;P&gt;data new4;&lt;BR /&gt;infile datalines missover ;&lt;BR /&gt;input x y $ z $;&lt;BR /&gt;datalines;&lt;BR /&gt;1 a b&lt;BR /&gt;1 a c&lt;BR /&gt;2 b c&lt;BR /&gt;2 b d&lt;BR /&gt;3 r t&lt;BR /&gt;3 r y&lt;BR /&gt;;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;I want my output to be&lt;BR /&gt;A new column need to be generated ICD whose value will be&lt;BR /&gt;x y ICD&lt;BR /&gt;1 a b, c&lt;BR /&gt;2 b c,d&lt;BR /&gt;3 r t,y&lt;BR /&gt;&lt;BR /&gt;I need this output through &lt;STRONG&gt;proc sql &lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Dec 2017 10:37:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/concatenate-last-observation-variable-value/m-p/420054#M103336</guid>
      <dc:creator>Rohit12</dc:creator>
      <dc:date>2017-12-11T10:37:59Z</dc:date>
    </item>
    <item>
      <title>Re: concatenate last observation variable  value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/concatenate-last-observation-variable-value/m-p/420055#M103337</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data new4;
infile datalines missover ;
input x y $ z $;
datalines;
1 a b
1 a c
2 b c
2 b d
3 r t
3 r y
;
run;

proc sort data=new4;
	by x;
run;

data want;
	set new4;
	by x;
	if first.x then ICD=z;
	else ICD=catx(',',ICD,z);
	if last.x;

	retain ICD;
	keep x y ICD;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 11 Dec 2017 10:44:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/concatenate-last-observation-variable-value/m-p/420055#M103337</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2017-12-11T10:44:13Z</dc:date>
    </item>
    <item>
      <title>Re: concatenate last observation variable  value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/concatenate-last-observation-variable-value/m-p/420056#M103338</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/120326"&gt;@Rohit12&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;&lt;BR /&gt;I need this output through &lt;STRONG&gt;proc sql &lt;/STRONG&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Maxim 14.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Dec 2017 10:49:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/concatenate-last-observation-variable-value/m-p/420056#M103338</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-12-11T10:49:34Z</dc:date>
    </item>
    <item>
      <title>Re: concatenate last observation variable  value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/concatenate-last-observation-variable-value/m-p/420058#M103339</link>
      <description>&lt;P&gt;I need this thing through proc sql&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Dec 2017 11:02:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/concatenate-last-observation-variable-value/m-p/420058#M103339</guid>
      <dc:creator>Rohit12</dc:creator>
      <dc:date>2017-12-11T11:02:25Z</dc:date>
    </item>
    <item>
      <title>Re: concatenate last observation variable  value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/concatenate-last-observation-variable-value/m-p/420059#M103340</link>
      <description>&lt;P&gt;Not using the right tool is plain stupid. &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/31304"&gt;@PeterClemmensen&lt;/a&gt;'s suggestion aptly demonstrates the power of the data step for such a task.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Dec 2017 11:06:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/concatenate-last-observation-variable-value/m-p/420059#M103340</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-12-11T11:06:42Z</dc:date>
    </item>
    <item>
      <title>Re: concatenate last observation variable  value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/concatenate-last-observation-variable-value/m-p/420063#M103341</link>
      <description>&lt;P&gt;Proc sql does not do transposed data.&amp;nbsp; It is a language based on RDBMS, which is a normalised relational model.&amp;nbsp; To achieve the result through SQL, you would need to join each group back to the first group, which may be feasible if you have 1 or 2 groups, however if you have more than that then your code will become a mess.&amp;nbsp; Transposed data is&amp;nbsp;&lt;STRONG&gt;only&lt;/STRONG&gt; useful for review files - i.e. reports created for users.&amp;nbsp; It is very far from optimal when it comes to programming.&amp;nbsp; Thus first consider if you really want to do this, for what purpose, then use the right tool to do the job.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Dec 2017 11:18:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/concatenate-last-observation-variable-value/m-p/420063#M103341</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-12-11T11:18:45Z</dc:date>
    </item>
  </channel>
</rss>

