<?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: pros summary by group in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/pros-summary-by-group/m-p/886648#M350358</link>
    <description>&lt;P&gt;You should be able to replace the CLASS statement with a BY statement.&lt;/P&gt;
&lt;P&gt;The only difference in the output would be that the CLASS statement without the NWAY option on the PROC SUMMARY statement will include and extra observation with the overall maximum.&amp;nbsp; If you need it you can generate it by taking the MAX of the resulting summary dataset.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So see if that fixes your issue.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You might also want to just move the WHERE filtering to apply to the output instead of the input.&amp;nbsp; There might be a performance hit on the generated Teradata query to summarize those two extra groups, but it should be simple to remove them from the resulting output dataset instead.&lt;/P&gt;</description>
    <pubDate>Thu, 27 Jul 2023 14:54:54 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2023-07-27T14:54:54Z</dc:date>
    <item>
      <title>pros summary by group</title>
      <link>https://communities.sas.com/t5/SAS-Programming/pros-summary-by-group/m-p/886353#M350250</link>
      <description>&lt;P&gt;Hello friends,&lt;/P&gt;
&lt;P&gt;I run the following query in order to calculate max for each group.&lt;/P&gt;
&lt;P&gt;Please note that the raw data set is very big (500 million rows).&lt;/P&gt;
&lt;P&gt;First question:&lt;/P&gt;
&lt;P&gt;I ask to calculate max only for group that is not null or zero.&lt;/P&gt;
&lt;P&gt;In resulted data set I see one row with value null (for field&amp;nbsp;&lt;CODE class=" language-sas"&gt;Agreement_Account_Id)-WHY???&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;Second&amp;nbsp;question:&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;Here&amp;nbsp;are&amp;nbsp;warnings&amp;nbsp;I&amp;nbsp;recieve:&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;NOTE: SQL generation will be used to perform the initial summarization.&lt;BR /&gt;WARNING: The format F was not located on the database. In-database processing will proceed without it.&lt;BR /&gt;WARNING: Syntax error or access violation Syntax error: expected something between '(' and the string 'F'.&lt;BR /&gt;WARNING: The format F was not located on the database. In-database processing will proceed without it.&lt;BR /&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;What should I do to prevent these warnings?Why these warnings exist?&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc summary data=TeraData.VBM410_ACTIVE_LOAN_BAL(Where=(Agreement_Account_Id not in (0,.)));
var Fund_Actual_Payment_Count;
class Agreement_Account_Id;
output out=VBM410_ACTIVE_LOAN_BAL max=Mis_Tash_Paid;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 26 Jul 2023 07:12:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/pros-summary-by-group/m-p/886353#M350250</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2023-07-26T07:12:32Z</dc:date>
    </item>
    <item>
      <title>Re: pros summary by group</title>
      <link>https://communities.sas.com/t5/SAS-Programming/pros-summary-by-group/m-p/886369#M350254</link>
      <description>Have you tried to run proc contents to verify columns and formats for the table?&lt;BR /&gt;Are you using special options for the NULL teradata table values like for instance dbnull=, nullchar= or nullcharval=?</description>
      <pubDate>Wed, 26 Jul 2023 10:02:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/pros-summary-by-group/m-p/886369#M350254</guid>
      <dc:creator>JosvanderVelden</dc:creator>
      <dc:date>2023-07-26T10:02:27Z</dc:date>
    </item>
    <item>
      <title>Re: pros summary by group</title>
      <link>https://communities.sas.com/t5/SAS-Programming/pros-summary-by-group/m-p/886370#M350255</link>
      <description>&lt;P&gt;First question: look at a part of your data WITH YOUR OWN EYES and see if you can figure out why you only get one row in the output. Please look at the log and see what it is telling you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Second question: please learn that we can't help you at all if you show us a partial log, where we cannot see the code as it appears in the log.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jul 2023 10:10:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/pros-summary-by-group/m-p/886370#M350255</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-07-26T10:10:22Z</dc:date>
    </item>
    <item>
      <title>Re: pros summary by group</title>
      <link>https://communities.sas.com/t5/SAS-Programming/pros-summary-by-group/m-p/886446#M350271</link>
      <description>&lt;P&gt;It really looks like you are accessing an external DBMS table. Which means that perhaps it doesn't understand what your intent was when passing the . for missing to it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, does Teradata (have guess this is the DBMS as you haven't stated) support formats natively? The warning about the F format not found sounds likely to be a pretty fundamental problem especially with this&lt;/P&gt;
&lt;PRE&gt;Syntax error: expected something between '(' and the string 'F'&lt;/PRE&gt;
&lt;P&gt;as there is no place that you are passing a string F&amp;nbsp; after ( so that may be the symptom from the&lt;/P&gt;
&lt;PRE class="language-sas"&gt;&lt;CODE&gt;Agreement_Account_Id not in (0,.)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Just how many unique values of &lt;CODE class="  language-sas"&gt;Agreement_Account_Id&lt;/CODE&gt; are there? 500 million "rows" may be a bit much for Class processing and may want to be sorted and use By processing instead.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jul 2023 15:49:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/pros-summary-by-group/m-p/886446#M350271</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2023-07-26T15:49:48Z</dc:date>
    </item>
    <item>
      <title>Re: pros summary by group</title>
      <link>https://communities.sas.com/t5/SAS-Programming/pros-summary-by-group/m-p/886458#M350277</link>
      <description>&lt;P&gt;In a RDMS, null is different than in SAS.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Are you using a Viya installation or some other type that will pass a proc summary to SQL summarization? I cannot recall ever seeing that note for a proc summary/means before.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-SPOILER&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159549"&gt;@Ronein&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hello friends,&lt;/P&gt;
&lt;P&gt;I run the following query in order to calculate max for each group.&lt;/P&gt;
&lt;P&gt;Please note that the raw data set is very big (500 million rows).&lt;/P&gt;
&lt;P&gt;First question:&lt;/P&gt;
&lt;P&gt;I ask to calculate max only for group that is not null or zero.&lt;/P&gt;
&lt;P&gt;In resulted data set I see one row with value null (for field&amp;nbsp;&lt;CODE class=" language-sas"&gt;Agreement_Account_Id)-WHY???&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;Second&amp;nbsp;question:&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;Here&amp;nbsp;are&amp;nbsp;warnings&amp;nbsp;I&amp;nbsp;recieve:&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;NOTE: SQL generation will be used to perform the initial summarization.&lt;BR /&gt;WARNING: The format F was not located on the database. In-database processing will proceed without it.&lt;BR /&gt;WARNING: Syntax error or access violation Syntax error: expected something between '(' and the string 'F'.&lt;BR /&gt;WARNING: The format F was not located on the database. In-database processing will proceed without it.&lt;BR /&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;What should I do to prevent these warnings?Why these warnings exist?&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc summary data=TeraData.VBM410_ACTIVE_LOAN_BAL(Where=(Agreement_Account_Id not in (0,.)));
var Fund_Actual_Payment_Count;
class Agreement_Account_Id;
output out=VBM410_ACTIVE_LOAN_BAL max=Mis_Tash_Paid;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;/LI-SPOILER&gt;</description>
      <pubDate>Wed, 26 Jul 2023 15:10:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/pros-summary-by-group/m-p/886458#M350277</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2023-07-26T15:10:34Z</dc:date>
    </item>
    <item>
      <title>Re: pros summary by group</title>
      <link>https://communities.sas.com/t5/SAS-Programming/pros-summary-by-group/m-p/886523#M350302</link>
      <description>&lt;P&gt;I strongly believe that no database designer worth their money will store an&amp;nbsp;&lt;STRONG&gt;I&lt;/STRONG&gt;&lt;STRONG&gt;D&lt;/STRONG&gt; as a number. So I guess your WHERE is faulty.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jul 2023 19:12:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/pros-summary-by-group/m-p/886523#M350302</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2023-07-26T19:12:37Z</dc:date>
    </item>
    <item>
      <title>Re: pros summary by group</title>
      <link>https://communities.sas.com/t5/SAS-Programming/pros-summary-by-group/m-p/886648#M350358</link>
      <description>&lt;P&gt;You should be able to replace the CLASS statement with a BY statement.&lt;/P&gt;
&lt;P&gt;The only difference in the output would be that the CLASS statement without the NWAY option on the PROC SUMMARY statement will include and extra observation with the overall maximum.&amp;nbsp; If you need it you can generate it by taking the MAX of the resulting summary dataset.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So see if that fixes your issue.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You might also want to just move the WHERE filtering to apply to the output instead of the input.&amp;nbsp; There might be a performance hit on the generated Teradata query to summarize those two extra groups, but it should be simple to remove them from the resulting output dataset instead.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jul 2023 14:54:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/pros-summary-by-group/m-p/886648#M350358</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-07-27T14:54:54Z</dc:date>
    </item>
  </channel>
</rss>

