<?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 Delete leading column with blank header in a sas dataset in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Delete-leading-column-with-blank-header-in-a-sas-dataset/m-p/322469#M71336</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a SAS dataset that has a leading column with a blank header.&amp;nbsp; How do I go about removing that column?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
    <pubDate>Wed, 04 Jan 2017 20:07:46 GMT</pubDate>
    <dc:creator>Aman1974</dc:creator>
    <dc:date>2017-01-04T20:07:46Z</dc:date>
    <item>
      <title>Delete leading column with blank header in a sas dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Delete-leading-column-with-blank-header-in-a-sas-dataset/m-p/322469#M71336</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a SAS dataset that has a leading column with a blank header.&amp;nbsp; How do I go about removing that column?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jan 2017 20:07:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Delete-leading-column-with-blank-header-in-a-sas-dataset/m-p/322469#M71336</guid>
      <dc:creator>Aman1974</dc:creator>
      <dc:date>2017-01-04T20:07:46Z</dc:date>
    </item>
    <item>
      <title>Re: Delete leading column with blank header in a sas dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Delete-leading-column-with-blank-header-in-a-sas-dataset/m-p/322474#M71338</link>
      <description>&lt;P&gt;If it's just a blank column you can drop it. I think you mean row?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Dropping a column would look like this,&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
set&amp;nbsp;have;
drop blank_field_name;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Typically a blank header comes from a file that has been imported, can you&amp;nbsp;modify the file before importing to remove the blank row?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If that's not the case you can do this many different ways.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;You could do something like,&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
set&amp;nbsp;have;
&amp;nbsp;IF _N_&amp;gt;=2;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Or do a data step to groom the data and use a line similar to if field='.' then delete; but then the field you are looking at for the blank may have blanks elsewhere in the data that get removed as well. It would look something like this,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
set&amp;nbsp;have;
&amp;nbsp;IF field='.' then delete;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Or use&amp;nbsp;the&amp;nbsp;&lt;SPAN&gt;option firstobs=2.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
set&amp;nbsp;have (firstobs=2);
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jan 2017 20:25:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Delete-leading-column-with-blank-header-in-a-sas-dataset/m-p/322474#M71338</guid>
      <dc:creator>TheShark</dc:creator>
      <dc:date>2017-01-04T20:25:56Z</dc:date>
    </item>
  </channel>
</rss>

