<?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: PROC SQL and Window Functions in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/PROC-SQL-and-Window-Functions/m-p/166235#M43061</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The opposite is true, see the documentation excerpt below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Typically if you need WINDOW type functions a data step in SAS is more appropriate. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you have a database, not SAS data set, you can use pass through SQL and pass native SQL code. &lt;/P&gt;&lt;P&gt;SAS 9.4 documentation:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/sqlproc/65065/HTML/default/viewer.htm#p0corah7t43hy7n1r7efplde5c8z.htm" title="http://support.sas.com/documentation/cdl/en/sqlproc/65065/HTML/default/viewer.htm#p0corah7t43hy7n1r7efplde5c8z.htm"&gt;SAS(R) 9.4 SQL Procedure User's Guide&lt;/A&gt;&lt;/P&gt;&lt;H1 class="xis-title" style="font-family: lato, arial, 'Arial Unicode MS', geneva, 'Lucida Grande', sans-serif; color: #353535; font-size: 20px; margin-top: 1.5em;"&gt;PROC SQL and the ANSI Standard&lt;/H1&gt;&lt;P class="xis-subTopic" style="font-family: lato, arial, 'Arial Unicode MS', geneva, 'Lucida Grande', sans-serif; border-top-width: 2px; border-top-style: solid; border-top-color: #d1d5db; margin-top: 2.5em; color: #353535;"&gt;&lt;A id="n075nn3l12w00an1g7xwa4clkgpj" style="font-family: inherit;"&gt;&lt;/A&gt;&lt;/P&gt;&lt;H2 class="xis-title" style="font-size: 16px; margin-top: 0.5em;"&gt;Compliance&lt;/H2&gt;&lt;DIV class="xis-topicContent"&gt;&lt;A id="p1hi298rr90xman1v7pvwzs2onaj" style="font-family: inherit;"&gt;&lt;/A&gt;&lt;DIV class="xis-paragraph" style="margin-top: 1.4em;"&gt;&lt;A id="n1c8wmybxiwfwpn13uaw1zye2vu0" style="font-family: inherit;"&gt;&lt;/A&gt;PROC SQL follows most of the guidelines set by the American National Standards Institute (ANSI) in its implementation of SQL. &lt;STRONG&gt;However, it is not fully compliant with the current ANSI standard for SQL.&lt;/STRONG&gt;&lt;SPAN class="xis-footnoteAnchor" style="font-size: 11px; padding-left: 0.2em;"&gt;&lt;A id="p0cs9ekojx4174n12z4ghi7mo2fv-orig1" style="font-family: inherit; color: #0e66ba; text-decoration: underline;"&gt;&lt;/A&gt; (&lt;A href="http://support.sas.com/documentation/cdl/en/sqlproc/65065/HTML/default/p0corah7t43hy7n1r7efplde5c8z.htm#p0cs9ekojx4174n12z4ghi7mo2fv-note1" style="text-decoration: underline; color: #0e66ba;"&gt;footnote1&lt;/A&gt;)&lt;/SPAN&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="xis-paragraph" style="margin-top: 1.4em;"&gt;&lt;A id="n1mv6ez33v3b7dn10k09d7x1kkfq" style="font-family: inherit;"&gt;&lt;/A&gt;The SQL research project at SAS has focused primarily on the expressive power of SQL as a query language. Consequently, some of the database features of SQL have not yet been implemented in PROC SQL.&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 31 Dec 2014 00:39:30 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2014-12-31T00:39:30Z</dc:date>
    <item>
      <title>PROC SQL and Window Functions</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-SQL-and-Window-Functions/m-p/166234#M43060</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm new to SAS and am interested in exploring PROC SQL capabilities because I have some experience working with SQL.&amp;nbsp; I'm using Base SAS 9.4.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've been through the PROC SQL examples in the SAS documentation, however I didn't see anything relating to Window functions.&amp;nbsp; From what I understood in the documentation, SAS SQL is ANSI compliant.&amp;nbsp; (If I'm running SQL on a SAS dataset versus connecting to some other database provider.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I created the following simple query to test a window aggregate function:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; select model, make, msrp,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SUM(MSRP) OVER() AS SumOfMSRP&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; from sashelp.cars;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However this isn't working.&amp;nbsp; The error highlights the OVER clause in my window aggregate function as the problem.&amp;nbsp; (For the most part, SAS appears to be expecting a comparison operator.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Has anyone had any success with using SQL Window Functions in PROC SQL when querying SAS datasets?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any insight is appreciated!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Stuart&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Dec 2014 00:03:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-SQL-and-Window-Functions/m-p/166234#M43060</guid>
      <dc:creator>stuart753</dc:creator>
      <dc:date>2014-12-31T00:03:26Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SQL and Window Functions</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-SQL-and-Window-Functions/m-p/166235#M43061</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The opposite is true, see the documentation excerpt below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Typically if you need WINDOW type functions a data step in SAS is more appropriate. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you have a database, not SAS data set, you can use pass through SQL and pass native SQL code. &lt;/P&gt;&lt;P&gt;SAS 9.4 documentation:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/sqlproc/65065/HTML/default/viewer.htm#p0corah7t43hy7n1r7efplde5c8z.htm" title="http://support.sas.com/documentation/cdl/en/sqlproc/65065/HTML/default/viewer.htm#p0corah7t43hy7n1r7efplde5c8z.htm"&gt;SAS(R) 9.4 SQL Procedure User's Guide&lt;/A&gt;&lt;/P&gt;&lt;H1 class="xis-title" style="font-family: lato, arial, 'Arial Unicode MS', geneva, 'Lucida Grande', sans-serif; color: #353535; font-size: 20px; margin-top: 1.5em;"&gt;PROC SQL and the ANSI Standard&lt;/H1&gt;&lt;P class="xis-subTopic" style="font-family: lato, arial, 'Arial Unicode MS', geneva, 'Lucida Grande', sans-serif; border-top-width: 2px; border-top-style: solid; border-top-color: #d1d5db; margin-top: 2.5em; color: #353535;"&gt;&lt;A id="n075nn3l12w00an1g7xwa4clkgpj" style="font-family: inherit;"&gt;&lt;/A&gt;&lt;/P&gt;&lt;H2 class="xis-title" style="font-size: 16px; margin-top: 0.5em;"&gt;Compliance&lt;/H2&gt;&lt;DIV class="xis-topicContent"&gt;&lt;A id="p1hi298rr90xman1v7pvwzs2onaj" style="font-family: inherit;"&gt;&lt;/A&gt;&lt;DIV class="xis-paragraph" style="margin-top: 1.4em;"&gt;&lt;A id="n1c8wmybxiwfwpn13uaw1zye2vu0" style="font-family: inherit;"&gt;&lt;/A&gt;PROC SQL follows most of the guidelines set by the American National Standards Institute (ANSI) in its implementation of SQL. &lt;STRONG&gt;However, it is not fully compliant with the current ANSI standard for SQL.&lt;/STRONG&gt;&lt;SPAN class="xis-footnoteAnchor" style="font-size: 11px; padding-left: 0.2em;"&gt;&lt;A id="p0cs9ekojx4174n12z4ghi7mo2fv-orig1" style="font-family: inherit; color: #0e66ba; text-decoration: underline;"&gt;&lt;/A&gt; (&lt;A href="http://support.sas.com/documentation/cdl/en/sqlproc/65065/HTML/default/p0corah7t43hy7n1r7efplde5c8z.htm#p0cs9ekojx4174n12z4ghi7mo2fv-note1" style="text-decoration: underline; color: #0e66ba;"&gt;footnote1&lt;/A&gt;)&lt;/SPAN&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="xis-paragraph" style="margin-top: 1.4em;"&gt;&lt;A id="n1mv6ez33v3b7dn10k09d7x1kkfq" style="font-family: inherit;"&gt;&lt;/A&gt;The SQL research project at SAS has focused primarily on the expressive power of SQL as a query language. Consequently, some of the database features of SQL have not yet been implemented in PROC SQL.&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Dec 2014 00:39:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-SQL-and-Window-Functions/m-p/166235#M43061</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2014-12-31T00:39:30Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SQL and Window Functions</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-SQL-and-Window-Functions/m-p/166236#M43062</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There is now also PROC FedSQL which is core ANSI compliant &lt;A href="http://support.sas.com/documentation/cdl/en/fedsqlref/67364/HTML/default/viewer.htm#p0eu9g66k11bren1d3a8edsgo5ey.htm" title="http://support.sas.com/documentation/cdl/en/fedsqlref/67364/HTML/default/viewer.htm#p0eu9g66k11bren1d3a8edsgo5ey.htm"&gt;SAS(R) 9.4 FedSQL Language Reference, Third Edition&lt;/A&gt; - but this doesn't mean everything has been implemented and there are still no WINDOW type functions (you can always use them directly with native data base SQL using explicit pass-through).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PROC FedSQL is rather new and not commonly used (yet?) so it's may be better you get first familiar with PROC SQL &lt;A href="http://support.sas.com/documentation/cdl/en/sqlproc/65065/HTML/default/viewer.htm#p12ohgh32ffm6un13s7l2d5p9c8y.htm" title="http://support.sas.com/documentation/cdl/en/sqlproc/65065/HTML/default/viewer.htm#p12ohgh32ffm6un13s7l2d5p9c8y.htm"&gt;SAS(R) 9.4 SQL Procedure User's Guide&lt;/A&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When working with data bases make sure to also use these manuals &lt;A href="http://support.sas.com/documentation/cdl/en/acreldb/67589/HTML/default/viewer.htm#titlepage.htm" title="http://support.sas.com/documentation/cdl/en/acreldb/67589/HTML/default/viewer.htm#titlepage.htm"&gt;SAS/ACCESS(R) 9.4 for Relational Databases: Reference, Sixth Edition&lt;/A&gt; , for example when it comes to the list of functions which SAS can pass down to the data base for execution &lt;A href="http://support.sas.com/documentation/cdl/en/acreldb/67589/HTML/default/viewer.htm#p0f64yzzxbsg8un1uwgstc6fivjd.htm" title="http://support.sas.com/documentation/cdl/en/acreldb/67589/HTML/default/viewer.htm#p0f64yzzxbsg8un1uwgstc6fivjd.htm"&gt;SAS/ACCESS(R) 9.4 for Relational Databases: Reference, Sixth Edition&lt;/A&gt; .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Dec 2014 01:25:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-SQL-and-Window-Functions/m-p/166236#M43062</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2014-12-31T01:25:28Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SQL and Window Functions</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-SQL-and-Window-Functions/m-p/166237#M43063</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The equivalent to keep in mind for SAS is BY group processing, available in data steps and many procs. &lt;/P&gt;&lt;P&gt;Though it does typically require a sorted data set. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Dec 2014 02:31:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-SQL-and-Window-Functions/m-p/166237#M43063</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2014-12-31T02:31:01Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SQL and Window Functions</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-SQL-and-Window-Functions/m-p/166238#M43064</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;SAS does not support those functions. But it can do your particular example because it will re-merge summary statistics back onto detail records.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;proc sql;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp; select model, make, msrp,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SUM(MSRP) /* OVER() */ AS SumOfMSRP&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; from sashelp.cars;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Dec 2014 05:05:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-SQL-and-Window-Functions/m-p/166238#M43064</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2014-12-31T05:05:44Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SQL and Window Functions</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-SQL-and-Window-Functions/m-p/166239#M43065</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Reeza, Patrick and Tom, Thank you all for your replies.&amp;nbsp; As I begin to learn SAS, it's very helpful to get the perspectives of experts!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've been going through the SAS training course called 'SAS Programming 1: Essentials' and I know from that content there are other ways to achieve SQL Window function capabilities within a Data Step.&amp;nbsp; My question arose more from me trying to avoid having to learn new material - I was trying to stick with what is familiar to me.&amp;nbsp; &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reeza - I went through the SAS documentation once more on PROC SQL and I still don't see anything pertaining to the lack of Windows function capability.&amp;nbsp; On my original research I did see the statement that not all database features of SQL have been implemented in PROC SQL, however I didn't see anything specific to Window functions. Perhaps this is called out specifically somewhere else and I missed it?&amp;nbsp; Or perhaps this is a situation where it's up to the user to find out which standard ANSI capabilities have yet to be implemented by SAS?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Patrick - I'll check out the other documentation sources you've suggested.&amp;nbsp; I'll probably also take your advice and try to get more familiar with PROC SQL before exploring PROC FedSQL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tom - That's a very helpful tip, I did not realize that could be done.&amp;nbsp; Do you know if there's anyway to create the summary statistic taking the SUM of Make instead of the entire data set?&amp;nbsp; My sample code below accomplishes this, but I'm wondering if this can be done in PROC SQL.&amp;nbsp; (I'm new to SAS so I welcome any improvement suggestions for my code below.&amp;nbsp; It seems like I have a lot of steps to accomplish something rather simple.)&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;title;&lt;BR /&gt;data work.test (keep = model make type msrp);&lt;BR /&gt; set sashelp.cars;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;proc sort data=work.test;&lt;BR /&gt; by make type;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;proc means data=work.test sum NOPRINT;&lt;BR /&gt; var msrp;&lt;BR /&gt; class make;&lt;BR /&gt; output out=work.testAgg sum=SumOfMSRP;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;data work.testAgg;&lt;BR /&gt; set work.testAgg;&lt;BR /&gt; if _TYPE_=1;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;data work.testReport;&lt;BR /&gt; merge work.test work.testAgg;&lt;BR /&gt; by make;&lt;BR /&gt; drop _TYPE_;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;title 'My Test Report';&lt;BR /&gt;proc print data=work.testReport;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;Thank you for your help.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;Stuart&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Dec 2014 18:16:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-SQL-and-Window-Functions/m-p/166239#M43065</guid>
      <dc:creator>stuart753</dc:creator>
      <dc:date>2014-12-31T18:16:50Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SQL and Window Functions</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-SQL-and-Window-Functions/m-p/166240#M43066</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Unlike standard SQL, in SAS you can have more variables than in the group statement when summarizing, though this does give you a warning in the log.&lt;/P&gt;&lt;P&gt;This SQL is the equivalent of your code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New'; color: #011993;"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;sql&lt;/STRONG&gt;&lt;SPAN style="color: #000000;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New'; color: #0433ff;"&gt;create&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;table&lt;SPAN style="color: #000000;"&gt; want &lt;/SPAN&gt;as&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&lt;SPAN style="color: #0433ff;"&gt;select&lt;/SPAN&gt; make, model, type, msrp, sum(msrp) &lt;SPAN style="color: #0433ff;"&gt;as&lt;/SPAN&gt; sumMSRP &lt;SPAN style="color: #0433ff;"&gt;format&lt;/SPAN&gt;=&lt;SPAN style="color: #009193;"&gt;dollar12.&lt;/SPAN&gt;, count(*) &lt;SPAN style="color: #0433ff;"&gt;as&lt;/SPAN&gt; FREQ&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&lt;SPAN style="color: #0433ff;"&gt;from&lt;/SPAN&gt; sashelp.cars&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&lt;SPAN style="color: #0433ff;"&gt;group&lt;/SPAN&gt; &lt;SPAN style="color: #0433ff;"&gt;by&lt;/SPAN&gt; make;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New'; color: #011993;"&gt;&lt;STRONG&gt;quit&lt;/STRONG&gt;&lt;SPAN style="color: #000000;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Dec 2014 18:21:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-SQL-and-Window-Functions/m-p/166240#M43066</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2014-12-31T18:21:41Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SQL and Window Functions</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-SQL-and-Window-Functions/m-p/166241#M43067</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Reeza,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Wow... I wouldn't have expected that result.&amp;nbsp; That certainly simplifies things from what I posted and I'll have to remember this exception when writing SQL against SAS datasets.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for posting this very helpful approach!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Stuart&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Dec 2014 18:46:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-SQL-and-Window-Functions/m-p/166241#M43067</guid>
      <dc:creator>stuart753</dc:creator>
      <dc:date>2014-12-31T18:46:00Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SQL and Window Functions</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-SQL-and-Window-Functions/m-p/166242#M43068</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It is extremely painful when having to write SQL for other system that do not do allow the inclusion of columns that are not grouping or aggregate columns.&lt;/P&gt;&lt;P&gt;PROC SQL mainly conforms to &lt;A href="http://en.wikipedia.org/wiki/SQL-92" title="http://en.wikipedia.org/wiki/SQL-92"&gt;SQL-92 - Wikipedia, the free encyclopedia&lt;/A&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;. Window functions were not added to SQL standards until &lt;/SPAN&gt;&lt;A href="http://en.wikipedia.org/wiki/SQL:2003" style="font-size: 10pt; line-height: 1.5em;" title="http://en.wikipedia.org/wiki/SQL:2003"&gt;SQL:2003 - Wikipedia, the free encyclope&lt;/A&gt;.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Dec 2014 18:55:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-SQL-and-Window-Functions/m-p/166242#M43068</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2014-12-31T18:55:49Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SQL and Window Functions</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-SQL-and-Window-Functions/m-p/166243#M43069</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That is what GROUP BY is for.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select make,sum(msrp) as sum_msrp &lt;/P&gt;&lt;P&gt;from sashelp.cars&lt;/P&gt;&lt;P&gt;group by make&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Dec 2014 19:01:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-SQL-and-Window-Functions/m-p/166243#M43069</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2014-12-31T19:01:19Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SQL and Window Functions</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-SQL-and-Window-Functions/m-p/166244#M43070</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Tom,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The way you've used GROUP BY is in line with ANSI SQL Standard because you're aggregating msrp and your other variable, make, is included in both the SELECT and GROUP BY. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What Reeza posted is not standard SQL because model, type and msrp are not contained in either an aggregate function or the GROUP BY clause.&amp;nbsp; However what she posted works on a SAS dataset (with a warning in the log as she stated).&amp;nbsp; This appears to be some hybrid functionality SAS added for PROC SQL on SAS datasets??&amp;nbsp; This would not work on a pass-through.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can see where this would get confusing...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Stuart&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Dec 2014 19:52:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-SQL-and-Window-Functions/m-p/166244#M43070</guid>
      <dc:creator>stuart753</dc:creator>
      <dc:date>2014-12-31T19:52:24Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SQL and Window Functions</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-SQL-and-Window-Functions/m-p/166245#M43071</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The SAS solution pre-dates WINDOW function in SQL standards. It is less powerful than WINDOW functions, but much easier to code.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Dec 2014 19:56:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-SQL-and-Window-Functions/m-p/166245#M43071</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2014-12-31T19:56:04Z</dc:date>
    </item>
  </channel>
</rss>

