<?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: Removing empty line breaks in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Removing-empty-line-breaks/m-p/391812#M94185</link>
    <description>&lt;P&gt;That worked quite well actually but I'm having an issue where two "blocks" of text are now back to back and I would like to be able to seperate them either with a "-" or just remove the space that separates two blocks of text.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Line 1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Line 2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What Compress(text, ,"kw") does:&lt;/P&gt;&lt;P&gt;Line 1 Line 2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;what would be ideal&lt;/P&gt;&lt;P&gt;Line 1&lt;/P&gt;&lt;P&gt;Line2&lt;/P&gt;</description>
    <pubDate>Wed, 30 Aug 2017 13:12:58 GMT</pubDate>
    <dc:creator>camfarrell25</dc:creator>
    <dc:date>2017-08-30T13:12:58Z</dc:date>
    <item>
      <title>Removing empty line breaks</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Removing-empty-line-breaks/m-p/391714#M94150</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm curently trying to remove some empty line breaks (as shown in the attachments) in order to export to excel and it'll look like that.&lt;/P&gt;&lt;P&gt;I'm then transposing a collection of these strings variables and concatenating them before exporting to excel.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've tried a few options compress with '0A'x, with '0D'x, with '&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ', trim but with no succes...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;CF&lt;/P&gt;</description>
      <pubDate>Wed, 30 Aug 2017 02:59:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Removing-empty-line-breaks/m-p/391714#M94150</guid>
      <dc:creator>camfarrell25</dc:creator>
      <dc:date>2017-08-30T02:59:33Z</dc:date>
    </item>
    <item>
      <title>Re: Removing empty line breaks</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Removing-empty-line-breaks/m-p/391758#M94169</link>
      <description>&lt;P&gt;Have you tried compress with 'kw' (keep writable) ?&lt;/P&gt;
&lt;P&gt;//Fredrik&lt;/P&gt;</description>
      <pubDate>Wed, 30 Aug 2017 09:29:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Removing-empty-line-breaks/m-p/391758#M94169</guid>
      <dc:creator>FredrikE</dc:creator>
      <dc:date>2017-08-30T09:29:02Z</dc:date>
    </item>
    <item>
      <title>Re: Removing empty line breaks</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Removing-empty-line-breaks/m-p/391765#M94171</link>
      <description>&lt;P&gt;As &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13827"&gt;@FredrikE&lt;/a&gt;&amp;nbsp;mentions, the kw compress option is an excellent way to remove the non-printable characters (first 32 sign in the ASCII symbol table)&lt;/P&gt;&lt;P&gt;You might as well want to remove these symbols in the labels too:&lt;/P&gt;&lt;PRE&gt;**Delete the chars;
DATA want;
   SET sheet1;
   array allChars _CHARACTER_;
   do over allChars;
      allChars=compress(allChars,,'kw');
   end;
RUN;

**Replace not printable characters in labels too;
DATA _NULL_;
   set sashelp.vcolumn end=eof;
   where libname eq "WORK" and memname eq "WANT" and not missing(label);
   label=compress(label,,'kw');
   if _N_ eq 1 then call execute('PROC DATASETS lib='||strip(libname)||' nolist; modify '||strip(memname)||';');
   call execute('label '||strip(name)||'= "'||strip(label)||'";');
   if eof then call execute('RUN; QUIT;');
RUN;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yet&amp;nbsp;sometimes this might result in a string concatenation where a line break is separating 2 words.&lt;/P&gt;&lt;P&gt;In this case you need a work-around&lt;/P&gt;&lt;P&gt;-to replace the line breaks by a space&lt;/P&gt;&lt;P&gt;-remove duplicate blanks&lt;/P&gt;&lt;P&gt;-remove leading/trailing blanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;DATA want2;
   SET sheet1;
   length byteSearch $32;
   array allChars _CHARACTER_;
   do byteI=1 to 31;
      byteSearch=strip(byteSearch)||byte(byteI);
   end;
   do over allChars;
      allChars=strip(compbl(translate(allChars,repeat(' ',33),byteSearch)));
   end;
   drop byte:;
RUN;&lt;/PRE&gt;</description>
      <pubDate>Wed, 30 Aug 2017 10:17:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Removing-empty-line-breaks/m-p/391765#M94171</guid>
      <dc:creator>Oligolas</dc:creator>
      <dc:date>2017-08-30T10:17:31Z</dc:date>
    </item>
    <item>
      <title>Re: Removing empty line breaks</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Removing-empty-line-breaks/m-p/391812#M94185</link>
      <description>&lt;P&gt;That worked quite well actually but I'm having an issue where two "blocks" of text are now back to back and I would like to be able to seperate them either with a "-" or just remove the space that separates two blocks of text.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Line 1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Line 2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What Compress(text, ,"kw") does:&lt;/P&gt;&lt;P&gt;Line 1 Line 2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;what would be ideal&lt;/P&gt;&lt;P&gt;Line 1&lt;/P&gt;&lt;P&gt;Line2&lt;/P&gt;</description>
      <pubDate>Wed, 30 Aug 2017 13:12:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Removing-empty-line-breaks/m-p/391812#M94185</guid>
      <dc:creator>camfarrell25</dc:creator>
      <dc:date>2017-08-30T13:12:58Z</dc:date>
    </item>
    <item>
      <title>Re: Removing empty line breaks</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Removing-empty-line-breaks/m-p/391932#M94222</link>
      <description>&lt;P&gt;Are you sure that you have any line breaks in the data? The file you showed looked to have and empty cell instead. &amp;nbsp;So if your OLD dataset has a single variable named HAVE you can make a new dataset name NEW that has the empty rows removed.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data new ;
  set old;
  if missing(have) then delete;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 30 Aug 2017 16:46:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Removing-empty-line-breaks/m-p/391932#M94222</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2017-08-30T16:46:41Z</dc:date>
    </item>
  </channel>
</rss>

