<?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 Removing columns from SAS dataset using regular expression or pattern in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Removing-columns-from-SAS-dataset-using-regular-expression-or/m-p/365282#M86737</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have following columns in my sas data set lets say.&lt;/P&gt;&lt;P&gt;some_column1&lt;/P&gt;&lt;P&gt;some_column2&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;RES_1111&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;RES_1112&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;RES_1113&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;mape_RES_1111&lt;/P&gt;&lt;P&gt;mape_RES_1112&lt;/P&gt;&lt;P&gt;mape_RES_1113&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if i have to remove all the columns in bold starting with a particular prefix 'RES_'&lt;/P&gt;&lt;P&gt;then how do I delete or remove all the columns starting from 'RES_'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;any regular expression, LIKE % operator kind of thing in SAS?&lt;/P&gt;</description>
    <pubDate>Thu, 08 Jun 2017 08:33:55 GMT</pubDate>
    <dc:creator>captainprice0</dc:creator>
    <dc:date>2017-06-08T08:33:55Z</dc:date>
    <item>
      <title>Removing columns from SAS dataset using regular expression or pattern</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Removing-columns-from-SAS-dataset-using-regular-expression-or/m-p/365282#M86737</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have following columns in my sas data set lets say.&lt;/P&gt;&lt;P&gt;some_column1&lt;/P&gt;&lt;P&gt;some_column2&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;RES_1111&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;RES_1112&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;RES_1113&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;mape_RES_1111&lt;/P&gt;&lt;P&gt;mape_RES_1112&lt;/P&gt;&lt;P&gt;mape_RES_1113&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if i have to remove all the columns in bold starting with a particular prefix 'RES_'&lt;/P&gt;&lt;P&gt;then how do I delete or remove all the columns starting from 'RES_'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;any regular expression, LIKE % operator kind of thing in SAS?&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jun 2017 08:33:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Removing-columns-from-SAS-dataset-using-regular-expression-or/m-p/365282#M86737</guid>
      <dc:creator>captainprice0</dc:creator>
      <dc:date>2017-06-08T08:33:55Z</dc:date>
    </item>
    <item>
      <title>Re: Removing columns from SAS dataset using regular expression or pattern</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Removing-columns-from-SAS-dataset-using-regular-expression-or/m-p/365285#M86738</link>
      <description>&lt;P&gt;Simple, SAS has options for this:&lt;/P&gt;
&lt;PRE&gt;data want;
  set have (drop=res_:);
run;&lt;/PRE&gt;
&lt;P&gt;Note the colon after the prefix, means all with that prefix. &amp;nbsp;If you had a range of variables, you could do:&lt;/P&gt;
&lt;PRE&gt;data want;
  set have (drop=res_1111--res_1113);
run;&lt;/PRE&gt;
&lt;P&gt;This would remove any variable which has a logical position and including res_1111 and res_1113 in the dataset.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jun 2017 08:46:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Removing-columns-from-SAS-dataset-using-regular-expression-or/m-p/365285#M86738</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-06-08T08:46:37Z</dc:date>
    </item>
    <item>
      <title>Re: Removing columns from SAS dataset using regular expression or pattern</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Removing-columns-from-SAS-dataset-using-regular-expression-or/m-p/365286#M86739</link>
      <description>&lt;P&gt;Simple example&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
infile datalines;
input some_column1 RES_1111 RES_1112 mape_RES_1111;
datalines;
1 
2 
3 
4 
;

data want;
	set have;
	drop res_:;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 08 Jun 2017 08:48:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Removing-columns-from-SAS-dataset-using-regular-expression-or/m-p/365286#M86739</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2017-06-08T08:48:33Z</dc:date>
    </item>
  </channel>
</rss>

