<?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: SQL MAX for sub groups in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SQL-MAX-for-sub-groups/m-p/792884#M254071</link>
    <description>&lt;P&gt;You omitted the code that caused the first ERROR. Please post the &lt;EM&gt;complete&lt;/EM&gt; log including all code and the messages resulting form it, and &lt;U&gt;&lt;STRONG&gt;use the button I showed you&lt;/STRONG&gt;&lt;/U&gt;.&lt;/P&gt;
&lt;P&gt;Do not hit "Reply" in the notification email you get, because that leads to a stripped-down interface without most of the options. Click on the thread title, and then hit "Reply" once the discussion is opened in a full-fledged browser window.&lt;/P&gt;</description>
    <pubDate>Thu, 27 Jan 2022 15:26:57 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2022-01-27T15:26:57Z</dc:date>
    <item>
      <title>SQL MAX for sub groups</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SQL-MAX-for-sub-groups/m-p/792728#M254008</link>
      <description>&lt;P&gt;Hi - I am trying to get SAS to create a new table from the data which includes the maximum from one variable for each plot and year and the average for another variable from each plot and year. Any ideas what is wrong with this code?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt;create table two as&lt;BR /&gt;select plot, year, max(psylla_N_young_L) as maxNymph,avg(NE_avg_BT) as NEavg&lt;BR /&gt;from Gen3&lt;BR /&gt;group by plot, year;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jan 2022 01:42:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SQL-MAX-for-sub-groups/m-p/792728#M254008</guid>
      <dc:creator>tianna</dc:creator>
      <dc:date>2022-01-27T01:42:22Z</dc:date>
    </item>
    <item>
      <title>Re: SQL MAX for sub groups</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SQL-MAX-for-sub-groups/m-p/792737#M254012</link>
      <description>&lt;P&gt;Looks good to me.&lt;/P&gt;
&lt;P&gt;Maybe try ending the proc sql with "quit;" instead of ending it with "run;".&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jan 2022 03:27:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SQL-MAX-for-sub-groups/m-p/792737#M254012</guid>
      <dc:creator>franriv</dc:creator>
      <dc:date>2022-01-27T03:27:29Z</dc:date>
    </item>
    <item>
      <title>Re: SQL MAX for sub groups</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SQL-MAX-for-sub-groups/m-p/792744#M254014</link>
      <description>&lt;P&gt;Why to you think something is wrong?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you have a symptom you should describe it. We won't know what is happening without your details.&lt;/P&gt;
&lt;P&gt;Otherwise the question and answers end up like pulling hen's teeth.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Often the place to start sharing is to copy the text of the procedure or data step along with the notes, warnings and/or errors from the LOG for the bit you question. On the forum open a text box using the &amp;lt;/&amp;gt; icon that appears above the message window and paste the copied text.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The text box helps as many of the messages in the log may have diagnostic characters that get moved if pasted into the main message windows as it reformats text.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you do not have a log entry that usually means that something is incomplete in the code.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jan 2022 05:04:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SQL-MAX-for-sub-groups/m-p/792744#M254014</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-01-27T05:04:26Z</dc:date>
    </item>
    <item>
      <title>Re: SQL MAX for sub groups</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SQL-MAX-for-sub-groups/m-p/792794#M254032</link>
      <description>&lt;P&gt;Maxim 2 says Read the Log. Therefore it is essential that we can see your log, so please copy/paste the whole log text of your step into a window opened with this button:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Bildschirmfoto 2020-04-07 um 08.32.59.jpg" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/54552i914D97BE1B0F21E5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Bildschirmfoto 2020-04-07 um 08.32.59.jpg" alt="Bildschirmfoto 2020-04-07 um 08.32.59.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jan 2022 10:08:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SQL-MAX-for-sub-groups/m-p/792794#M254032</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-01-27T10:08:17Z</dc:date>
    </item>
    <item>
      <title>Re: SQL MAX for sub groups</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SQL-MAX-for-sub-groups/m-p/792875#M254069</link>
      <description>&lt;P&gt;Here is the log with the error code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;BR /&gt;NOTE: PROCEDURE SQL used (Total process time):&lt;BR /&gt;real time 1:12.09&lt;BR /&gt;cpu time 0.95 seconds&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1315 Proc import&lt;BR /&gt;1316 DATAFILE="C:\Users\tianna.dupont\Documents\analysis\Alldataallyrs(2021.12.13)forSAS2.xlsx"&lt;BR /&gt;1317 OUT=Thresholds&lt;BR /&gt;1318 DBMS=xlsx&lt;BR /&gt;1319 REPLACE;&lt;BR /&gt;1320 GETNAMES=yes;&lt;BR /&gt;1321 run;&lt;/P&gt;&lt;P&gt;NOTE: One or more variables were converted because the data type is not supported by the V9&lt;BR /&gt;engine. For more details, run with options MSGLEVEL=I.&lt;BR /&gt;NOTE: The import data set has 2278 observations and 88 variables.&lt;BR /&gt;NOTE: WORK.THRESHOLDS data set was successfully created.&lt;BR /&gt;NOTE: PROCEDURE IMPORT used (Total process time):&lt;BR /&gt;real time 1.27 seconds&lt;BR /&gt;cpu time 1.28 seconds&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;1322&lt;BR /&gt;1323 data Gen3;&lt;BR /&gt;1324 set Thresholds;&lt;BR /&gt;1325 where PPDD between 2000 and 4000;&lt;BR /&gt;1326 run;&lt;/P&gt;&lt;P&gt;NOTE: There were 776 observations read from the data set WORK.THRESHOLDS.&lt;BR /&gt;WHERE (PPDD&amp;gt;=2000 and PPDD&amp;lt;=4000);&lt;BR /&gt;NOTE: The data set WORK.GEN3 has 776 observations and 88 variables.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;real time 0.00 seconds&lt;BR /&gt;cpu time 0.01 seconds&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;1327&lt;BR /&gt;1328 proc sql;&lt;BR /&gt;1329 create table two as&lt;BR /&gt;1330 select plot, year, max(psylla_N_young_L) as maxNymph,&lt;BR /&gt;1331 from Gen3&lt;BR /&gt;----&lt;BR /&gt;1&lt;BR /&gt;1332 group by plot, year;&lt;BR /&gt;--&lt;BR /&gt;79&lt;BR /&gt;WARNING 1-322: Assuming the symbol GE was misspelled as Gen3.&lt;/P&gt;&lt;P&gt;ERROR 79-322: Expecting a FROM.&lt;/P&gt;&lt;P&gt;1333 run;&lt;BR /&gt;NOTE: PROC SQL statements are executed immediately; The RUN statement has no effect.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jan 2022 14:41:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SQL-MAX-for-sub-groups/m-p/792875#M254069</guid>
      <dc:creator>tianna</dc:creator>
      <dc:date>2022-01-27T14:41:25Z</dc:date>
    </item>
    <item>
      <title>Re: SQL MAX for sub groups</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SQL-MAX-for-sub-groups/m-p/792878#M254070</link>
      <description>&lt;P&gt;You have an extra comma.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When you have a single statement that spans multiple lines place the continuation characters, like the commas between variables in an SQL SELECT statement or the AND in a series of conditions in an ON or WHERE clause, at the START of the new line instead of the END of the old line.&amp;nbsp; That way it will be easier for a human to scan the SAS code to confirm the formatting is correct.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jan 2022 14:56:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SQL-MAX-for-sub-groups/m-p/792878#M254070</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-01-27T14:56:55Z</dc:date>
    </item>
    <item>
      <title>Re: SQL MAX for sub groups</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SQL-MAX-for-sub-groups/m-p/792884#M254071</link>
      <description>&lt;P&gt;You omitted the code that caused the first ERROR. Please post the &lt;EM&gt;complete&lt;/EM&gt; log including all code and the messages resulting form it, and &lt;U&gt;&lt;STRONG&gt;use the button I showed you&lt;/STRONG&gt;&lt;/U&gt;.&lt;/P&gt;
&lt;P&gt;Do not hit "Reply" in the notification email you get, because that leads to a stripped-down interface without most of the options. Click on the thread title, and then hit "Reply" once the discussion is opened in a full-fledged browser window.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jan 2022 15:26:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SQL-MAX-for-sub-groups/m-p/792884#M254071</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-01-27T15:26:57Z</dc:date>
    </item>
    <item>
      <title>Re: SQL MAX for sub groups</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SQL-MAX-for-sub-groups/m-p/792897#M254076</link>
      <description>&lt;P&gt;The issue was with the data set. It had periods to replace missing data which had to be removed so it read as numeric. Resolved.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jan 2022 15:46:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SQL-MAX-for-sub-groups/m-p/792897#M254076</guid>
      <dc:creator>tianna</dc:creator>
      <dc:date>2022-01-27T15:46:56Z</dc:date>
    </item>
  </channel>
</rss>

