<?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 How to combine multiple select statements under one PROC SQL in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-combine-multiple-select-statements-under-one-PROC-SQL/m-p/686205#M33046</link>
    <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;Hope you all are doing great and stay safe during the pandemic. I would like to combine several "Select" statements where I calculate the average of the variables under one "Proc SQL". Below is the code I use and it works, but I use this code for each variable separately and producing unnecessary files. I want to get the average of other variables like length, age, ... for the same ID under this code. I appreciate your time and help.&lt;/P&gt;</description>
    <pubDate>Wed, 23 Sep 2020 20:15:08 GMT</pubDate>
    <dc:creator>mmhxc5</dc:creator>
    <dc:date>2020-09-23T20:15:08Z</dc:date>
    <item>
      <title>How to combine multiple select statements under one PROC SQL</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-combine-multiple-select-statements-under-one-PROC-SQL/m-p/686205#M33046</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;Hope you all are doing great and stay safe during the pandemic. I would like to combine several "Select" statements where I calculate the average of the variables under one "Proc SQL". Below is the code I use and it works, but I use this code for each variable separately and producing unnecessary files. I want to get the average of other variables like length, age, ... for the same ID under this code. I appreciate your time and help.&lt;/P&gt;</description>
      <pubDate>Wed, 23 Sep 2020 20:15:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-combine-multiple-select-statements-under-one-PROC-SQL/m-p/686205#M33046</guid>
      <dc:creator>mmhxc5</dc:creator>
      <dc:date>2020-09-23T20:15:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine multiple select statements under one PROC SQL</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-combine-multiple-select-statements-under-one-PROC-SQL/m-p/686210#M33047</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
create table want as
  select
    id,
    avg(var1) as var1,
    avg(var2) as var2
  from have
  group by id
;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 23 Sep 2020 20:34:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-combine-multiple-select-statements-under-one-PROC-SQL/m-p/686210#M33047</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-09-23T20:34:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine multiple select statements under one PROC SQL</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-combine-multiple-select-statements-under-one-PROC-SQL/m-p/686211#M33048</link>
      <description>PROC MEANS is almost always a better option once you're looking at multiple variables, statistics and at different levels. &lt;BR /&gt;FYI - your SQL code was not included.</description>
      <pubDate>Wed, 23 Sep 2020 20:35:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-combine-multiple-select-statements-under-one-PROC-SQL/m-p/686211#M33048</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-09-23T20:35:29Z</dc:date>
    </item>
  </channel>
</rss>

