<?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: reading raw data in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/reading-raw-data/m-p/410112#M100231</link>
    <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/144247"&gt;@shivamarrora0&lt;/a&gt;:&lt;/P&gt;&lt;P&gt;Here is a possible solution:&lt;/P&gt;&lt;PRE&gt;data want;
  do until(last.id);
    set have;
    by id;
    length max_include $1 concat $20;
    call catx(',',concat,exclude);
    if max_include&amp;lt;include then
      max_include=include;
    end;
  drop exclude include;
run;&lt;/PRE&gt;&lt;P&gt;But it is not quite clear what you want if you have multiple, different&amp;nbsp;non-blank values for INCLUDE. If you want to concatenate them, like with exclude, change the&amp;nbsp;if...then section to a CATX call like for exclude (and remember to change the length and name of the output variable), if you just want the first non-blank value, you can use the COALESCEC() function.&lt;/P&gt;</description>
    <pubDate>Fri, 03 Nov 2017 08:20:36 GMT</pubDate>
    <dc:creator>s_lassen</dc:creator>
    <dc:date>2017-11-03T08:20:36Z</dc:date>
    <item>
      <title>reading raw data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/reading-raw-data/m-p/409825#M100150</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hi all, i need to solve the below issue&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Data is&lt;/P&gt;&lt;P&gt;id include exclude&lt;BR /&gt;a . abc&lt;BR /&gt;a . xyz&lt;BR /&gt;b j abf&lt;BR /&gt;b . gtj&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Output required is&lt;/P&gt;&lt;P&gt;a . abc,xyz&lt;BR /&gt;b j abf,gtj&lt;/P&gt;</description>
      <pubDate>Thu, 02 Nov 2017 14:06:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/reading-raw-data/m-p/409825#M100150</guid>
      <dc:creator>shivamarrora0</dc:creator>
      <dc:date>2017-11-02T14:06:51Z</dc:date>
    </item>
    <item>
      <title>Re: reading raw data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/reading-raw-data/m-p/409838#M100159</link>
      <description>&lt;P&gt;Look &lt;A href="https://communities.sas.com/t5/Base-SAS-Programming/Combine-Multiple-Rows-Values-into-One-Field/m-p/408010" target="_blank"&gt;here&lt;/A&gt; for a similar question with solution.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Nov 2017 14:30:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/reading-raw-data/m-p/409838#M100159</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-11-02T14:30:22Z</dc:date>
    </item>
    <item>
      <title>Re: reading raw data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/reading-raw-data/m-p/409840#M100160</link>
      <description>&lt;P&gt;Please describe rules.&lt;/P&gt;
&lt;P&gt;Is the rule to have all of the "Include" values separated by commas within each value of id as a single variable?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the value of Include duplicates within ID is each instance included or only one?&lt;/P&gt;
&lt;P&gt;How many distinct values of "include" might be involved? The variable to hold the values should be given a length long enough to hold all of them. The length would be (length of variable include)*(number of include values)+(number of include values minus 1) [the plus is to account for the lengths of the inserted commas]&lt;/P&gt;</description>
      <pubDate>Thu, 02 Nov 2017 14:33:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/reading-raw-data/m-p/409840#M100160</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-11-02T14:33:47Z</dc:date>
    </item>
    <item>
      <title>Re: reading raw data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/reading-raw-data/m-p/409845#M100163</link>
      <description>&lt;P&gt;rule is i want the data of 1 st raw&amp;nbsp;&lt;/P&gt;&lt;P&gt;then last value of 2nd raw&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;then 3rd row full and last value of 4th row&lt;/P&gt;</description>
      <pubDate>Thu, 02 Nov 2017 14:41:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/reading-raw-data/m-p/409845#M100163</guid>
      <dc:creator>shivamarrora0</dc:creator>
      <dc:date>2017-11-02T14:41:08Z</dc:date>
    </item>
    <item>
      <title>Re: reading raw data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/reading-raw-data/m-p/409847#M100165</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/144247"&gt;@shivamarrora0&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;rule is i want the data of 1 st raw&amp;nbsp;&lt;/P&gt;
&lt;P&gt;then last value of 2nd raw&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;then 3rd row full and last value of 4th row&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Really? Will your input dataset always consist of exactly four observations?&lt;/P&gt;</description>
      <pubDate>Thu, 02 Nov 2017 14:42:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/reading-raw-data/m-p/409847#M100165</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-11-02T14:42:37Z</dc:date>
    </item>
    <item>
      <title>Re: reading raw data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/reading-raw-data/m-p/409922#M100193</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Trying to use Kurt's solution posted above&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data mydata;
	input id:$1. include:$1. exclude:$3.;
datalines;
a . abc
a . xyz
b j abf
b . gtj
;
run;


data newdata;
	set mydata;
	retain myinclude concat ;
	by id;
	length myinclude $10.;
	length concat $10.;
	if first.id then myinclude = ""; 
	if first.id then concat = "";
	myinclude = catx('',myinclude,include);
	concat = catx(',',concat,exclude);
	if last.id then output;
	drop include exclude;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I can make&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE width="229"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="105"&gt;The SAS System&lt;/TD&gt;
&lt;TD width="72"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD width="52"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="105"&gt;id&lt;/TD&gt;
&lt;TD width="72"&gt;myinclude&lt;/TD&gt;
&lt;TD width="52"&gt;concat&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="105"&gt;a&lt;/TD&gt;
&lt;TD width="72"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD width="52"&gt;abc,xyz&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="105"&gt;b&lt;/TD&gt;
&lt;TD width="72"&gt;j&lt;/TD&gt;
&lt;TD width="52"&gt;abf,gtj&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Nov 2017 16:48:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/reading-raw-data/m-p/409922#M100193</guid>
      <dc:creator>HB</dc:creator>
      <dc:date>2017-11-02T16:48:48Z</dc:date>
    </item>
    <item>
      <title>Re: reading raw data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/reading-raw-data/m-p/410112#M100231</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/144247"&gt;@shivamarrora0&lt;/a&gt;:&lt;/P&gt;&lt;P&gt;Here is a possible solution:&lt;/P&gt;&lt;PRE&gt;data want;
  do until(last.id);
    set have;
    by id;
    length max_include $1 concat $20;
    call catx(',',concat,exclude);
    if max_include&amp;lt;include then
      max_include=include;
    end;
  drop exclude include;
run;&lt;/PRE&gt;&lt;P&gt;But it is not quite clear what you want if you have multiple, different&amp;nbsp;non-blank values for INCLUDE. If you want to concatenate them, like with exclude, change the&amp;nbsp;if...then section to a CATX call like for exclude (and remember to change the length and name of the output variable), if you just want the first non-blank value, you can use the COALESCEC() function.&lt;/P&gt;</description>
      <pubDate>Fri, 03 Nov 2017 08:20:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/reading-raw-data/m-p/410112#M100231</guid>
      <dc:creator>s_lassen</dc:creator>
      <dc:date>2017-11-03T08:20:36Z</dc:date>
    </item>
  </channel>
</rss>

