<?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 Selection of variables in a PROC SQL in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Selection-of-variables-in-a-PROC-SQL/m-p/899169#M355402</link>
    <description>&lt;P&gt;From this example,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;PROC SQL;

SELECT
CODE_VAR1,
CODE_VAR2,
CODE_VAR3,
CODE_VAR4,
CODE_VAR5,
VAR1,
VAR2,
VAR3,
VAR4,
VAR5

FROM SALE;

QUIT;
RUN; &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to know if it is possible not to repeat the name of the variables, as we can do with a KEEP in a DATA step:&amp;nbsp;CODE_VAR1-CODE_VAR15&amp;nbsp; VAR1-VAR5&amp;nbsp; ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 18 Oct 2023 20:37:39 GMT</pubDate>
    <dc:creator>sasuser_8</dc:creator>
    <dc:date>2023-10-18T20:37:39Z</dc:date>
    <item>
      <title>Selection of variables in a PROC SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Selection-of-variables-in-a-PROC-SQL/m-p/899169#M355402</link>
      <description>&lt;P&gt;From this example,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;PROC SQL;

SELECT
CODE_VAR1,
CODE_VAR2,
CODE_VAR3,
CODE_VAR4,
CODE_VAR5,
VAR1,
VAR2,
VAR3,
VAR4,
VAR5

FROM SALE;

QUIT;
RUN; &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to know if it is possible not to repeat the name of the variables, as we can do with a KEEP in a DATA step:&amp;nbsp;CODE_VAR1-CODE_VAR15&amp;nbsp; VAR1-VAR5&amp;nbsp; ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Oct 2023 20:37:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Selection-of-variables-in-a-PROC-SQL/m-p/899169#M355402</guid>
      <dc:creator>sasuser_8</dc:creator>
      <dc:date>2023-10-18T20:37:39Z</dc:date>
    </item>
    <item>
      <title>Re: Selection of variables in a PROC SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Selection-of-variables-in-a-PROC-SQL/m-p/899170#M355403</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;BR /&gt;I think this &lt;A href="https://www.lexjansen.com/nesug/nesug06/cc/cc05.pdf" target="_self"&gt;paper&lt;/A&gt; can answer your question.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Oct 2023 20:48:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Selection-of-variables-in-a-PROC-SQL/m-p/899170#M355403</guid>
      <dc:creator>A_Kh</dc:creator>
      <dc:date>2023-10-18T20:48:39Z</dc:date>
    </item>
    <item>
      <title>Re: Selection of variables in a PROC SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Selection-of-variables-in-a-PROC-SQL/m-p/899171#M355404</link>
      <description>&lt;P&gt;Just add a KEEP = option to your SALE dataset and change your SELECT to SELECT *.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Oct 2023 20:53:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Selection-of-variables-in-a-PROC-SQL/m-p/899171#M355404</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2023-10-18T20:53:23Z</dc:date>
    </item>
    <item>
      <title>Re: Selection of variables in a PROC SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Selection-of-variables-in-a-PROC-SQL/m-p/899172#M355405</link>
      <description>See my answer here under the FEEDBACK option.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://communities.sas.com/t5/SAS-Programming/Feedback-Option-in-Proc-SQL/td-p/419909" target="_blank"&gt;https://communities.sas.com/t5/SAS-Programming/Feedback-Option-in-Proc-SQL/td-p/419909&lt;/A&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 18 Oct 2023 20:56:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Selection-of-variables-in-a-PROC-SQL/m-p/899172#M355405</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2023-10-18T20:56:06Z</dc:date>
    </item>
    <item>
      <title>Re: Selection of variables in a PROC SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Selection-of-variables-in-a-PROC-SQL/m-p/899173#M355406</link>
      <description>&lt;P&gt;Why would you want to use SQL to select specific columns from an existing data set and do nothing else in SQL?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you are planning to run the data through another PROC after SQL.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc means data=sale(keep=code_var1-code_var5 var1-var5);
/* More PROC MEANS code */
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As always, context is important, the best approach depends on context, and you haven't given us the slightest hint about why you are doing this.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Oct 2023 21:00:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Selection-of-variables-in-a-PROC-SQL/m-p/899173#M355406</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-10-18T21:00:21Z</dc:date>
    </item>
  </channel>
</rss>

