<?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 how to delete blank lines in SAS code? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/how-to-delete-blank-lines-in-SAS-code/m-p/63516#M13799</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;within a program. thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 12 Sep 2011 17:47:27 GMT</pubDate>
    <dc:creator>Fisher</dc:creator>
    <dc:date>2011-09-12T17:47:27Z</dc:date>
    <item>
      <title>how to delete blank lines in SAS code?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-delete-blank-lines-in-SAS-code/m-p/63514#M13797</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a long SAS macro, and there are lots of blank lines within codes which I like to delete. &lt;/P&gt;&lt;P&gt;Anybody know how to do that trick? thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Sep 2011 16:41:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-delete-blank-lines-in-SAS-code/m-p/63514#M13797</guid>
      <dc:creator>Fisher</dc:creator>
      <dc:date>2011-09-12T16:41:50Z</dc:date>
    </item>
    <item>
      <title>how to delete blank lines in SAS code?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-delete-blank-lines-in-SAS-code/m-p/63515#M13798</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Blank lines within a program or within a macro variable?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Sep 2011 16:45:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-delete-blank-lines-in-SAS-code/m-p/63515#M13798</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2011-09-12T16:45:54Z</dc:date>
    </item>
    <item>
      <title>how to delete blank lines in SAS code?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-delete-blank-lines-in-SAS-code/m-p/63516#M13799</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;within a program. thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Sep 2011 17:47:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-delete-blank-lines-in-SAS-code/m-p/63516#M13799</guid>
      <dc:creator>Fisher</dc:creator>
      <dc:date>2011-09-12T17:47:27Z</dc:date>
    </item>
    <item>
      <title>how to delete blank lines in SAS code?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-delete-blank-lines-in-SAS-code/m-p/63517#M13800</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Depends on the tools you have.&amp;nbsp; You could use sed or other unix tools from the command line.&lt;/P&gt;&lt;P&gt;Not that hard to do with a data step.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;&amp;nbsp; infile 'old.sas' lrecl=1000;&lt;/P&gt;&lt;P&gt;&amp;nbsp; file 'new.sas' lrecl=1000;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if _infile_=' ' then delete;&lt;/P&gt;&lt;P&gt;* Why not remove those pesky trailing blanks some editors insert while we are at it. ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; len= length(_infile_);&lt;/P&gt;&lt;P&gt;&amp;nbsp; put _infile_ $varying1000. len ;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Sep 2011 18:20:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-delete-blank-lines-in-SAS-code/m-p/63517#M13800</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2011-09-12T18:20:30Z</dc:date>
    </item>
    <item>
      <title>how to delete blank lines in SAS code?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-delete-blank-lines-in-SAS-code/m-p/63518#M13801</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Actually there is a way to do it in SAS, but a little difficult to explain.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SAS has what are call keyboard macros and abbreviations (they are the same thing).&amp;nbsp; You can record your own by clicking on tools-&amp;gt;record macro.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Once one is recorded, it can be edited.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thru a combination of starting a macro to record, clicking on select all and find and entering what I wanted SAS to find, and then stopping and naming the macro, I was able to edit the macro to contain the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Select all&lt;/P&gt;&lt;P&gt;Regenerate leading whitespace&lt;/P&gt;&lt;P&gt;Remove trailing whitespace&lt;/P&gt;&lt;P&gt;Reset search&lt;/P&gt;&lt;P&gt;Set search direction to forward&lt;/P&gt;&lt;P&gt;Set search string to "^\n"&lt;/P&gt;&lt;P&gt;Set search to include comments&lt;/P&gt;&lt;P&gt;Set search to search code&lt;/P&gt;&lt;P&gt;Delete line&lt;/P&gt;&lt;P&gt;Replace all&lt;/P&gt;&lt;P&gt;Reset search&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That took all of about 30 seconds to create and I was able to assign the macro the a key (e.g., alt-c)&lt;/P&gt;&lt;P&gt;What the code is doing is removing white space in case you have blank looking lines, using a regular expression to find carriage returns at the start of lines, delete those lines once found.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In short, after creating the macro and assigning the key, pressing alt-c removed all blank lines.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let me know if you can't figure out how to do it as keyboard macros have another benefit .. they can be exported!&amp;nbsp; In short, I could easily send you the abbreviation and you could import it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Sep 2011 18:55:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-delete-blank-lines-in-SAS-code/m-p/63518#M13801</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2011-09-12T18:55:17Z</dc:date>
    </item>
    <item>
      <title>Re: how to delete blank lines in SAS code?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-delete-blank-lines-in-SAS-code/m-p/63519#M13802</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You could also us the 'Delete' or 'Backspace' key on your keyboard &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt; &lt;img id="smileywink" class="emoticon emoticon-smileywink" src="https://communities.sas.com/i/smilies/16x16_smiley-wink.png" alt="Smiley Wink" title="Smiley Wink" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Barry&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Sep 2011 19:51:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-delete-blank-lines-in-SAS-code/m-p/63519#M13802</guid>
      <dc:creator>twocanbazza</dc:creator>
      <dc:date>2011-09-12T19:51:00Z</dc:date>
    </item>
    <item>
      <title>how to delete blank lines in SAS code?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-delete-blank-lines-in-SAS-code/m-p/63520#M13803</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;if you are using unix you can do the following via the shell:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tr -s \n old.sas &amp;gt; new.sas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Sep 2011 19:51:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-delete-blank-lines-in-SAS-code/m-p/63520#M13803</guid>
      <dc:creator>FriedEgg</dc:creator>
      <dc:date>2011-09-12T19:51:14Z</dc:date>
    </item>
    <item>
      <title>how to delete blank lines in SAS code?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-delete-blank-lines-in-SAS-code/m-p/63521#M13804</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks art297. &lt;/P&gt;&lt;P&gt;I followed some of your explaination, but I really glad to find this features in SAS. I will try later again.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Sep 2011 21:39:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-delete-blank-lines-in-SAS-code/m-p/63521#M13804</guid>
      <dc:creator>Fisher</dc:creator>
      <dc:date>2011-09-12T21:39:13Z</dc:date>
    </item>
    <item>
      <title>how to delete blank lines in SAS code?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-delete-blank-lines-in-SAS-code/m-p/63522#M13805</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thansk Tom. &lt;/P&gt;&lt;P&gt;This code works perfectly in Windows.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Sep 2011 21:40:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-delete-blank-lines-in-SAS-code/m-p/63522#M13805</guid>
      <dc:creator>Fisher</dc:creator>
      <dc:date>2011-09-12T21:40:19Z</dc:date>
    </item>
    <item>
      <title>how to delete blank lines in SAS code?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-delete-blank-lines-in-SAS-code/m-p/63523#M13806</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I tried this command in Linux, but it only generated a blank new.sas.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Sep 2011 21:51:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-delete-blank-lines-in-SAS-code/m-p/63523#M13806</guid>
      <dc:creator>Fisher</dc:creator>
      <dc:date>2011-09-12T21:51:57Z</dc:date>
    </item>
    <item>
      <title>how to delete blank lines in SAS code?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-delete-blank-lines-in-SAS-code/m-p/63524#M13807</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;First the program would need to utilize unix style EOL characters or \n would need to properly identify the correct EOL.&amp;nbsp; You can preprocess by converting from dos2unix&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;dos2unix mymacro.sas&lt;/P&gt;&lt;P&gt;tr -s "\n" mymacro.sas &amp;gt; mymacro_new.sas&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tr will squeeze (-s) duplicate apperances of the EOL char ("\n") and leave single apperances intact.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Sep 2011 22:18:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-delete-blank-lines-in-SAS-code/m-p/63524#M13807</guid>
      <dc:creator>FriedEgg</dc:creator>
      <dc:date>2011-09-12T22:18:10Z</dc:date>
    </item>
  </channel>
</rss>

