<?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: Select specific columns ending with same word in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Select-specific-columns-ending-with-same-word/m-p/484540#M125802</link>
    <description>Hi&lt;BR /&gt;Some columns end with _b and others with _e. I want to keep those ending with _e.&lt;BR /&gt;Thanks&lt;BR /&gt;</description>
    <pubDate>Mon, 06 Aug 2018 21:19:22 GMT</pubDate>
    <dc:creator>karine</dc:creator>
    <dc:date>2018-08-06T21:19:22Z</dc:date>
    <item>
      <title>Select specific columns ending with same word</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Select-specific-columns-ending-with-same-word/m-p/484534#M125798</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;From a table with many columns, how to select only the columns ending with the same word?&lt;/P&gt;&lt;P&gt;Thanks&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Aug 2018 21:00:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Select-specific-columns-ending-with-same-word/m-p/484534#M125798</guid>
      <dc:creator>karine</dc:creator>
      <dc:date>2018-08-06T21:00:31Z</dc:date>
    </item>
    <item>
      <title>Re: Select specific columns ending with same word</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Select-specific-columns-ending-with-same-word/m-p/484538#M125801</link>
      <description>&lt;P&gt;ending with the same &lt;EM&gt;&lt;STRONG&gt;word&lt;/STRONG&gt;&lt;/EM&gt; or &lt;EM&gt;&lt;STRONG&gt;letter&lt;/STRONG&gt;&lt;/EM&gt;?&lt;/P&gt;
&lt;P&gt;if word, the var name should be delimited with something like (_) I would think&lt;/P&gt;</description>
      <pubDate>Mon, 06 Aug 2018 21:15:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Select-specific-columns-ending-with-same-word/m-p/484538#M125801</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-08-06T21:15:44Z</dc:date>
    </item>
    <item>
      <title>Re: Select specific columns ending with same word</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Select-specific-columns-ending-with-same-word/m-p/484540#M125802</link>
      <description>Hi&lt;BR /&gt;Some columns end with _b and others with _e. I want to keep those ending with _e.&lt;BR /&gt;Thanks&lt;BR /&gt;</description>
      <pubDate>Mon, 06 Aug 2018 21:19:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Select-specific-columns-ending-with-same-word/m-p/484540#M125802</guid>
      <dc:creator>karine</dc:creator>
      <dc:date>2018-08-06T21:19:22Z</dc:date>
    </item>
    <item>
      <title>Re: Select specific columns ending with same word</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Select-specific-columns-ending-with-same-word/m-p/484544#M125805</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
t_1e=.;
t_2e=.;
t_3e=.;
t_1b=.;
t_2b=.;
run;



proc sql;
select name into : var separated by ' '
from dictionary.columns
where libname='WORK' and memname='HAVE'
and  char(upcase(name),length(name))='E';
quit;

%put &amp;amp;var;

data want;
set have(keep=&amp;amp;var);
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Aug 2018 21:28:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Select-specific-columns-ending-with-same-word/m-p/484544#M125805</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-08-06T21:28:11Z</dc:date>
    </item>
    <item>
      <title>Re: Select specific columns ending with same word</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Select-specific-columns-ending-with-same-word/m-p/484565#M125811</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/224962"&gt;@karine&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;From a table with many columns, how to select only the columns ending with the same word?&lt;/P&gt;
&lt;P&gt;Thanks&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Use this as a learning point for naming variables. If you know that you might have some requirement like this it would be better to originally name them as e_something. Then the task of using those names becomes three characters: e_: which would use all the variables that start with e_ .&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Another consideration could be "what is the rest of the text of the name". If you have variables like House_e and House_b , Car_e and Car_b, a bunch of paired names. Perhaps your data would work better in a transposed form where you have a variable that takes on values of House and Car then two variable _e and _b.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Aug 2018 22:56:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Select-specific-columns-ending-with-same-word/m-p/484565#M125811</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-08-06T22:56:10Z</dc:date>
    </item>
    <item>
      <title>Re: Select specific columns ending with same word</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Select-specific-columns-ending-with-same-word/m-p/484966#M125932</link>
      <description>&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Wed, 08 Aug 2018 02:10:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Select-specific-columns-ending-with-same-word/m-p/484966#M125932</guid>
      <dc:creator>karine</dc:creator>
      <dc:date>2018-08-08T02:10:58Z</dc:date>
    </item>
  </channel>
</rss>

