<?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: How do I remove blank rows from my data? in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-do-I-remove-blank-rows-from-my-data/m-p/356030#M23446</link>
    <description>&lt;P&gt;You may want to verify that Ref_no is numeric. Are you getting any messages about numeric to character conversion.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Generally it is more reliable to use&lt;/P&gt;
&lt;P&gt;where not missing(variablename) ;&lt;/P&gt;
&lt;P&gt;as the missing function will work for either numeric or character.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And actually I would go back to the data step that reads the data and add:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if not missing(ref_no);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;to remove the problem bits earlier.&lt;/P&gt;</description>
    <pubDate>Thu, 04 May 2017 16:17:53 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2017-05-04T16:17:53Z</dc:date>
    <item>
      <title>How do I remove blank rows from my data?</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-do-I-remove-blank-rows-from-my-data/m-p/356026#M23444</link>
      <description>&lt;P&gt;I have a data set that I'm working with that comes to me missing rows in random places. It looks something like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;Ref_No&lt;/U&gt; &amp;nbsp; &amp;nbsp; &lt;U&gt;Loc&lt;/U&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;U&gt;Amnt&lt;/U&gt;&lt;/P&gt;&lt;P&gt;1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; NM &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;$50&lt;/P&gt;&lt;P&gt;2 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; WA &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;$42&lt;/P&gt;&lt;P&gt;3 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ND &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $71&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;4 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ME &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $28&lt;/P&gt;&lt;P&gt;5 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; CA &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;$93&lt;/P&gt;&lt;P&gt;6 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; CT &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;$62&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've managed to read the data into SAS EG by telling the load editor to read to a specific column and row, but when I go to sort the data, in order to take out the blank rows using the following code, the program stops reading when it reaches a blank row which leaves out a whole bunch of data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sort data=work.original_file out=work.new_file;
by Ref_No;
where Ref_No ne .;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any idea what I can use to remove the blank rows without the program&amp;nbsp;cutting off rows below the blank ones?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Thu, 04 May 2017 16:13:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-do-I-remove-blank-rows-from-my-data/m-p/356026#M23444</guid>
      <dc:creator>dsw243</dc:creator>
      <dc:date>2017-05-04T16:13:59Z</dc:date>
    </item>
    <item>
      <title>Re: How do I remove blank rows from my data?</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-do-I-remove-blank-rows-from-my-data/m-p/356030#M23446</link>
      <description>&lt;P&gt;You may want to verify that Ref_no is numeric. Are you getting any messages about numeric to character conversion.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Generally it is more reliable to use&lt;/P&gt;
&lt;P&gt;where not missing(variablename) ;&lt;/P&gt;
&lt;P&gt;as the missing function will work for either numeric or character.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And actually I would go back to the data step that reads the data and add:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if not missing(ref_no);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;to remove the problem bits earlier.&lt;/P&gt;</description>
      <pubDate>Thu, 04 May 2017 16:17:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-do-I-remove-blank-rows-from-my-data/m-p/356030#M23446</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-05-04T16:17:53Z</dc:date>
    </item>
    <item>
      <title>Re: How do I remove blank rows from my data?</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-do-I-remove-blank-rows-from-my-data/m-p/356034#M23448</link>
      <description>&lt;P&gt;Yuck! Don't you love crappy source data?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This happens to me quite a lot. My preference is to read the whole record into a temporary variable, and then parse out the bits that I want. If the quality is acceptable, I keep it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Something like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; have(&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;drop&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=_:);&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;length&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; _InRec $&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;32767&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;input&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;_InRec = _infile_;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;if&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; ^missing(_InRec)&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;then&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;do&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#008000" face="Courier New" size="2"&gt;/* other processes to check if we have what we want */&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt; Var1 = scan(_InRec, &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;);&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt; Var2 = scan(_InRec, &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;2&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;);&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt; Var3 = scan(_InRec, &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;3&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;);&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#008000" face="Courier New" size="2"&gt;/* other processes to check if we have what we want */&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#008000" face="Courier New" size="2"&gt;/* assume we set GoodFlag to 1 or 0 if the data are acceptable */&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#008000" face="Courier New" size="2"&gt;/* if acceptable conditions then */&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt; _GoodFlag = &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#008000" face="Courier New" size="2"&gt;/* else _GoodFlag = 0 */&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;if&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; _GoodFlag &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;then&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;output&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;end&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;cards&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;1 2 3&lt;/P&gt;
&lt;P&gt;4 6&lt;/P&gt;
&lt;P&gt;7 8 9&lt;/P&gt;
&lt;P&gt;11&lt;/P&gt;
&lt;P&gt;12 13&lt;/P&gt;
&lt;P&gt;14 15 16&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 04 May 2017 16:23:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-do-I-remove-blank-rows-from-my-data/m-p/356034#M23448</guid>
      <dc:creator>TomKari</dc:creator>
      <dc:date>2017-05-04T16:23:55Z</dc:date>
    </item>
    <item>
      <title>Re: How do I remove blank rows from my data?</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-do-I-remove-blank-rows-from-my-data/m-p/356038#M23450</link>
      <description>&lt;P&gt;These are both great solutions, thank you so much!&lt;/P&gt;</description>
      <pubDate>Thu, 04 May 2017 16:29:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-do-I-remove-blank-rows-from-my-data/m-p/356038#M23450</guid>
      <dc:creator>dsw243</dc:creator>
      <dc:date>2017-05-04T16:29:43Z</dc:date>
    </item>
  </channel>
</rss>

