<?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: delete column with condition in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/delete-column-with-condition/m-p/447004#M112223</link>
    <description>This probably need that you first query the table, and based on that issue your drop column statement. Macro logic is what I see.&lt;BR /&gt;&lt;BR /&gt;There have been a lot of similar question on the communities, especially when all column uses are missing. Do a search and youbwould be able to learn from those.</description>
    <pubDate>Tue, 20 Mar 2018 05:32:45 GMT</pubDate>
    <dc:creator>LinusH</dc:creator>
    <dc:date>2018-03-20T05:32:45Z</dc:date>
    <item>
      <title>delete column with condition</title>
      <link>https://communities.sas.com/t5/SAS-Programming/delete-column-with-condition/m-p/446943#M112216</link>
      <description>&lt;P&gt;i have data &amp;nbsp;with columns Names (win ,unix,sas,sep..etc) and data with yes and no. i want to delete the column&amp;nbsp;without giving the column name.(ex: if sas column has all 'No' data).'&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Tue, 20 Mar 2018 11:40:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/delete-column-with-condition/m-p/446943#M112216</guid>
      <dc:creator>radha009</dc:creator>
      <dc:date>2018-03-20T11:40:45Z</dc:date>
    </item>
    <item>
      <title>Re: delete column with condition</title>
      <link>https://communities.sas.com/t5/SAS-Programming/delete-column-with-condition/m-p/447004#M112223</link>
      <description>This probably need that you first query the table, and based on that issue your drop column statement. Macro logic is what I see.&lt;BR /&gt;&lt;BR /&gt;There have been a lot of similar question on the communities, especially when all column uses are missing. Do a search and youbwould be able to learn from those.</description>
      <pubDate>Tue, 20 Mar 2018 05:32:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/delete-column-with-condition/m-p/447004#M112223</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2018-03-20T05:32:45Z</dc:date>
    </item>
    <item>
      <title>Re: delete column with condition</title>
      <link>https://communities.sas.com/t5/SAS-Programming/delete-column-with-condition/m-p/447035#M112228</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
    input col1 $ col2 $ col3 $;
cards;
Yes No No
No No Yes
Yes No Yes
;
run;

data NULL_;
    set have end=eof;
    array cols(*) col:;
    array nos(3)_TEMPORARY_;

    do i=1 to dim(cols);
        if strip(cols(i))="No" then nos(i)+1;
    end;

    if eof then do;
        call execute('data want; set have;');
        if max(of nos(*))=_N_ then do;
            call execute('drop');
            do i=1 to dim(cols);
                if nos(i)=_N_ then do;
                    call execute(vname(cols(i)));
                end;
            end;
        end;
call execute('; run;');
    end;
run;

&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 20 Mar 2018 08:58:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/delete-column-with-condition/m-p/447035#M112228</guid>
      <dc:creator>gamotte</dc:creator>
      <dc:date>2018-03-20T08:58:45Z</dc:date>
    </item>
    <item>
      <title>Re: delete column with condition</title>
      <link>https://communities.sas.com/t5/SAS-Programming/delete-column-with-condition/m-p/447129#M112255</link>
      <description>&lt;P&gt;Perfect. thanks a lot.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Mar 2018 14:37:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/delete-column-with-condition/m-p/447129#M112255</guid>
      <dc:creator>radha009</dc:creator>
      <dc:date>2018-03-20T14:37:05Z</dc:date>
    </item>
  </channel>
</rss>

