<?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: How to keep/drop variables using PROC SQL? in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-keep-drop-variables-using-PROC-SQL/m-p/76156#M3647</link>
    <description>Perhaps you need to read more about SQL.  Your syntax is missing the comma separators and the WHERE clause.  Beyond the manual, Lafler and Prairie have good books in the BBU series.&lt;BR /&gt;
&lt;BR /&gt;
If all the datasets have the same variables, including bill1-bill3 in each, then an equijoin will probably not get you what you want.  The last data set in (ds3) will provide the data values and the data values from ds1 and ds2 will be lost.&lt;BR /&gt;
&lt;BR /&gt;
If the incoming datasets have a common variable called, say,  "bill" and you want to do an equijoin and rename it to bill1, bill2, and bill3 on output, that can be done.&lt;BR /&gt;
&lt;BR /&gt;
SELECT &lt;BR /&gt;
  ds1.bill AS bill1,&lt;BR /&gt;
  ds2.bill AS bill2,&lt;BR /&gt;
  ds3.bill AS bill3&lt;BR /&gt;
FROM&lt;BR /&gt;
  ds1, ds2, ds3&lt;BR /&gt;
WHERE&lt;BR /&gt;
  &lt;EQUIJOIN condition=""&gt;&lt;BR /&gt;
;&lt;/EQUIJOIN&gt;</description>
    <pubDate>Thu, 22 Apr 2010 16:25:35 GMT</pubDate>
    <dc:creator>Doc_Duke</dc:creator>
    <dc:date>2010-04-22T16:25:35Z</dc:date>
    <item>
      <title>How to keep/drop variables using PROC SQL?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-keep-drop-variables-using-PROC-SQL/m-p/76153#M3644</link>
      <description>I like using PROC SQL since it is the easiest to use. How do I keep/drop variables using PROC SQL?</description>
      <pubDate>Thu, 22 Apr 2010 02:02:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-keep-drop-variables-using-PROC-SQL/m-p/76153#M3644</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-04-22T02:02:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to keep/drop variables using PROC SQL?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-keep-drop-variables-using-PROC-SQL/m-p/76154#M3645</link>
      <description>One way to drop variables is actually not to include them in the select statement.&lt;BR /&gt;
&lt;BR /&gt;
Instead of &lt;BR /&gt;
&lt;BR /&gt;
SELECT * from ...&lt;BR /&gt;
&lt;BR /&gt;
you could use &lt;BR /&gt;
&lt;BR /&gt;
SELECT T.x1,T.x2,T.x27 from ...</description>
      <pubDate>Thu, 22 Apr 2010 15:05:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-keep-drop-variables-using-PROC-SQL/m-p/76154#M3645</guid>
      <dc:creator>Paige</dc:creator>
      <dc:date>2010-04-22T15:05:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to keep/drop variables using PROC SQL?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-keep-drop-variables-using-PROC-SQL/m-p/76155#M3646</link>
      <description>What if I want to equijoin 3 data sets and the data sets have same variables. I only want to see BILL1-BILL3 variables. How do I use SELECT statement? This is what I have below.&lt;BR /&gt;
&lt;BR /&gt;
PROQ SQL;&lt;BR /&gt;
SELECT BILL1 BILL2 BILL3&lt;BR /&gt;
FROM DS1 DS2 DS3&lt;BR /&gt;
QUIT;</description>
      <pubDate>Thu, 22 Apr 2010 15:41:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-keep-drop-variables-using-PROC-SQL/m-p/76155#M3646</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-04-22T15:41:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to keep/drop variables using PROC SQL?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-keep-drop-variables-using-PROC-SQL/m-p/76156#M3647</link>
      <description>Perhaps you need to read more about SQL.  Your syntax is missing the comma separators and the WHERE clause.  Beyond the manual, Lafler and Prairie have good books in the BBU series.&lt;BR /&gt;
&lt;BR /&gt;
If all the datasets have the same variables, including bill1-bill3 in each, then an equijoin will probably not get you what you want.  The last data set in (ds3) will provide the data values and the data values from ds1 and ds2 will be lost.&lt;BR /&gt;
&lt;BR /&gt;
If the incoming datasets have a common variable called, say,  "bill" and you want to do an equijoin and rename it to bill1, bill2, and bill3 on output, that can be done.&lt;BR /&gt;
&lt;BR /&gt;
SELECT &lt;BR /&gt;
  ds1.bill AS bill1,&lt;BR /&gt;
  ds2.bill AS bill2,&lt;BR /&gt;
  ds3.bill AS bill3&lt;BR /&gt;
FROM&lt;BR /&gt;
  ds1, ds2, ds3&lt;BR /&gt;
WHERE&lt;BR /&gt;
  &lt;EQUIJOIN condition=""&gt;&lt;BR /&gt;
;&lt;/EQUIJOIN&gt;</description>
      <pubDate>Thu, 22 Apr 2010 16:25:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-keep-drop-variables-using-PROC-SQL/m-p/76156#M3647</guid>
      <dc:creator>Doc_Duke</dc:creator>
      <dc:date>2010-04-22T16:25:35Z</dc:date>
    </item>
  </channel>
</rss>

