<?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: drop variables with same prefix in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/drop-variables-with-same-prefix/m-p/201716#M266866</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you please show your code that you used?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 14 Mar 2015 18:04:52 GMT</pubDate>
    <dc:creator>naveen_srini</dc:creator>
    <dc:date>2015-03-14T18:04:52Z</dc:date>
    <item>
      <title>drop variables with same prefix</title>
      <link>https://communities.sas.com/t5/SAS-Programming/drop-variables-with-same-prefix/m-p/201712#M266862</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; hi i have 800+variables. some of the variables have CGOV as a common prefix. i wanted to drop all of them. how may i do this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thx,&lt;/P&gt;&lt;P&gt;aaron&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 14 Mar 2015 17:56:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/drop-variables-with-same-prefix/m-p/201712#M266862</guid>
      <dc:creator>aarony</dc:creator>
      <dc:date>2015-03-14T17:56:03Z</dc:date>
    </item>
    <item>
      <title>Re: drop variables with same prefix</title>
      <link>https://communities.sas.com/t5/SAS-Programming/drop-variables-with-same-prefix/m-p/201713#M266863</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;drop CGOV:&amp;nbsp; ;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 14 Mar 2015 17:59:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/drop-variables-with-same-prefix/m-p/201713#M266863</guid>
      <dc:creator>naveen_srini</dc:creator>
      <dc:date>2015-03-14T17:59:13Z</dc:date>
    </item>
    <item>
      <title>Re: drop variables with same prefix</title>
      <link>https://communities.sas.com/t5/SAS-Programming/drop-variables-with-same-prefix/m-p/201714#M266864</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;not working...get an error:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WARNING: The variable EC in the DROP, KEEP, or RENAME list has never been referenced.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 14 Mar 2015 18:01:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/drop-variables-with-same-prefix/m-p/201714#M266864</guid>
      <dc:creator>aarony</dc:creator>
      <dc:date>2015-03-14T18:01:00Z</dc:date>
    </item>
    <item>
      <title>Re: drop variables with same prefix</title>
      <link>https://communities.sas.com/t5/SAS-Programming/drop-variables-with-same-prefix/m-p/201715#M266865</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;EC?&amp;nbsp; Naveen suggested that you use &lt;STRONG style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;drop CGOV: ;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Show your code.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 14 Mar 2015 18:04:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/drop-variables-with-same-prefix/m-p/201715#M266865</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2015-03-14T18:04:22Z</dc:date>
    </item>
    <item>
      <title>Re: drop variables with same prefix</title>
      <link>https://communities.sas.com/t5/SAS-Programming/drop-variables-with-same-prefix/m-p/201716#M266866</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you please show your code that you used?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 14 Mar 2015 18:04:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/drop-variables-with-same-prefix/m-p/201716#M266866</guid>
      <dc:creator>naveen_srini</dc:creator>
      <dc:date>2015-03-14T18:04:52Z</dc:date>
    </item>
    <item>
      <title>Re: drop variables with same prefix</title>
      <link>https://communities.sas.com/t5/SAS-Programming/drop-variables-with-same-prefix/m-p/201717#M266867</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;oh. sorry. it works with the colon! this is very very helpful. thank you so much.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;do u by any chance have an idea, how to drop the same suffixes? ie: _C.&lt;/P&gt;&lt;P&gt;i have variables that ends with _C: for example, xxx_C. how may i drop them?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thankyou!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 14 Mar 2015 18:08:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/drop-variables-with-same-prefix/m-p/201717#M266867</guid>
      <dc:creator>aarony</dc:creator>
      <dc:date>2015-03-14T18:08:01Z</dc:date>
    </item>
    <item>
      <title>Re: drop variables with same prefix</title>
      <link>https://communities.sas.com/t5/SAS-Programming/drop-variables-with-same-prefix/m-p/201718#M266868</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;just along the lines, how may i rename those variables that ends with _C to without them?&lt;/P&gt;&lt;P&gt;ideally i would like, aaa_c-&amp;gt;aaa&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;many thanks in advance!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 14 Mar 2015 18:10:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/drop-variables-with-same-prefix/m-p/201718#M266868</guid>
      <dc:creator>aarony</dc:creator>
      <dc:date>2015-03-14T18:10:24Z</dc:date>
    </item>
    <item>
      <title>Re: drop variables with same prefix</title>
      <link>https://communities.sas.com/t5/SAS-Programming/drop-variables-with-same-prefix/m-p/201719#M266869</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If all variables are in an order, you can prolly use&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;drop yourfirstvariable_C --yourlastvariable_C ;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 14 Mar 2015 18:22:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/drop-variables-with-same-prefix/m-p/201719#M266869</guid>
      <dc:creator>naveen_srini</dc:creator>
      <dc:date>2015-03-14T18:22:31Z</dc:date>
    </item>
    <item>
      <title>Re: drop variables with same prefix</title>
      <link>https://communities.sas.com/t5/SAS-Programming/drop-variables-with-same-prefix/m-p/201720#M266870</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Rename is similar to suffix.&amp;nbsp; You need to query the list of names.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;proc&lt;/STRONG&gt; &lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;contents&lt;/STRONG&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;data&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;=have &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;out&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;=contents(keep=name) &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;noprint&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; ; &lt;/SPAN&gt;&lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;proc&lt;/STRONG&gt; &lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;sql&lt;/STRONG&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;noprint&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;select&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; catx(&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;'='&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;,name,substr(name,&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;1&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;,length(name)-&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;2&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;))&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;into&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; :renames separated &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;by&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;' '&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;from&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; contents &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;where&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; upcase(name) like &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;'%^_C'&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; escape &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;'^'&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;quit&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;data&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; want ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;set&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; have (&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;rename&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;=(&amp;amp;renames));&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 14 Mar 2015 18:28:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/drop-variables-with-same-prefix/m-p/201720#M266870</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2015-03-14T18:28:57Z</dc:date>
    </item>
  </channel>
</rss>

