<?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: Strange behaviour of  proc SQL + Proc CORR in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Strange-behaviour-of-proc-SQL-Proc-CORR/m-p/690143#M79656</link>
    <description>&lt;P&gt;Boundaries, where code blocks start/stop, are defined by QUIT, RUN, DATA and PROC. ODS is not a boundary statement.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;The issue in this case is you do not explicitly terminate the prior procedure so the ODS OUTPUT statement is mapped to the SQL procedure not the PROC CORR.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you move the ODS OUTPUT to &lt;STRONG&gt;after&lt;/STRONG&gt; the PROC it's also fine because the PROC acts as a boundary. Basically, its an order of operations thing - you need to ensure the boundary is set before your ODS statements.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13941"&gt;@SPR&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;This simple program does not produce Pearson dataset:&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;data a;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; a=1; b=3; output;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; a=4; b=5; output;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;run;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;proc SQL noprint; select MAX(A) into :a trimmed from a; %put &amp;amp;=a;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;ODS output PearsonCorr=Pearson; &lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;proc CORR data=a;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; var a;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; with b;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;run;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;WARNING: Output 'PearsonCorr' was not created. Make sure that the output object name, label, or path is spelled correctly. Also, &lt;BR /&gt;verify that the appropriate procedure options are used to produce the requested output object. For example, verify that &lt;BR /&gt;the NOPRINT option is not used.&lt;BR /&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;The reason for this is absence of &lt;STRONG&gt;quit;&lt;/STRONG&gt; in&amp;nbsp; proc SQL code.&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Using&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;proc SQL noprint; select MAX(A) into :a trimmed from a; &lt;FONT color="#FF0000"&gt;quit;&lt;/FONT&gt; %put &amp;amp;=a;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;produces the expected output:&lt;/P&gt;
&lt;P&gt;NOTE: The data set WORK.PEARSON has 1 observations and 3 variables.&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt; I've noticed that some seasoned programmers do not put &lt;STRONG&gt;quit;&lt;/STRONG&gt;&amp;nbsp;in this type proc SQL code. This trick works fine in most cases but not every time. Or may be I'm wrong?&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 08 Oct 2020 19:02:15 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2020-10-08T19:02:15Z</dc:date>
    <item>
      <title>Strange behaviour of  proc SQL + Proc CORR</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Strange-behaviour-of-proc-SQL-Proc-CORR/m-p/690142#M79655</link>
      <description>&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;This simple program does not produce Pearson dataset:&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;data a;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; a=1; b=3; output;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; a=4; b=5; output;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;run;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;proc SQL noprint; select MAX(A) into :a trimmed from a; %put &amp;amp;=a;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;ODS output PearsonCorr=Pearson; &lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;proc CORR data=a;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; var a;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; with b;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;run;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;WARNING: Output 'PearsonCorr' was not created. Make sure that the output object name, label, or path is spelled correctly. Also, &lt;BR /&gt;verify that the appropriate procedure options are used to produce the requested output object. For example, verify that &lt;BR /&gt;the NOPRINT option is not used.&lt;BR /&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;The reason for this is absence of &lt;STRONG&gt;quit;&lt;/STRONG&gt; in&amp;nbsp; proc SQL code.&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Using&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;proc SQL noprint; select MAX(A) into :a trimmed from a; &lt;FONT color="#FF0000"&gt;quit;&lt;/FONT&gt; %put &amp;amp;=a;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;produces the expected output:&lt;/P&gt;
&lt;P&gt;NOTE: The data set WORK.PEARSON has 1 observations and 3 variables.&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt; I've noticed that some seasoned programmers do not put &lt;STRONG&gt;quit;&lt;/STRONG&gt;&amp;nbsp;in this type proc SQL code. This trick works fine in most cases but not every time. Or may be I'm wrong?&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Oct 2020 18:57:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Strange-behaviour-of-proc-SQL-Proc-CORR/m-p/690142#M79655</guid>
      <dc:creator>SPR</dc:creator>
      <dc:date>2020-10-08T18:57:47Z</dc:date>
    </item>
    <item>
      <title>Re: Strange behaviour of  proc SQL + Proc CORR</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Strange-behaviour-of-proc-SQL-Proc-CORR/m-p/690143#M79656</link>
      <description>&lt;P&gt;Boundaries, where code blocks start/stop, are defined by QUIT, RUN, DATA and PROC. ODS is not a boundary statement.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;The issue in this case is you do not explicitly terminate the prior procedure so the ODS OUTPUT statement is mapped to the SQL procedure not the PROC CORR.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you move the ODS OUTPUT to &lt;STRONG&gt;after&lt;/STRONG&gt; the PROC it's also fine because the PROC acts as a boundary. Basically, its an order of operations thing - you need to ensure the boundary is set before your ODS statements.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13941"&gt;@SPR&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;This simple program does not produce Pearson dataset:&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;data a;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; a=1; b=3; output;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; a=4; b=5; output;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;run;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;proc SQL noprint; select MAX(A) into :a trimmed from a; %put &amp;amp;=a;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;ODS output PearsonCorr=Pearson; &lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;proc CORR data=a;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; var a;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; with b;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;run;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;WARNING: Output 'PearsonCorr' was not created. Make sure that the output object name, label, or path is spelled correctly. Also, &lt;BR /&gt;verify that the appropriate procedure options are used to produce the requested output object. For example, verify that &lt;BR /&gt;the NOPRINT option is not used.&lt;BR /&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;The reason for this is absence of &lt;STRONG&gt;quit;&lt;/STRONG&gt; in&amp;nbsp; proc SQL code.&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Using&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;proc SQL noprint; select MAX(A) into :a trimmed from a; &lt;FONT color="#FF0000"&gt;quit;&lt;/FONT&gt; %put &amp;amp;=a;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;produces the expected output:&lt;/P&gt;
&lt;P&gt;NOTE: The data set WORK.PEARSON has 1 observations and 3 variables.&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt; I've noticed that some seasoned programmers do not put &lt;STRONG&gt;quit;&lt;/STRONG&gt;&amp;nbsp;in this type proc SQL code. This trick works fine in most cases but not every time. Or may be I'm wrong?&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Oct 2020 19:02:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Strange-behaviour-of-proc-SQL-Proc-CORR/m-p/690143#M79656</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-10-08T19:02:15Z</dc:date>
    </item>
    <item>
      <title>Re: Strange behaviour of  proc SQL + Proc CORR</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Strange-behaviour-of-proc-SQL-Proc-CORR/m-p/690145#M79657</link>
      <description>I moved ODS output PearsonCorr=Pearson; inside the proc CORR and the program works fine without quit; Thanks.</description>
      <pubDate>Thu, 08 Oct 2020 19:07:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Strange-behaviour-of-proc-SQL-Proc-CORR/m-p/690145#M79657</guid>
      <dc:creator>SPR</dc:creator>
      <dc:date>2020-10-08T19:07:22Z</dc:date>
    </item>
    <item>
      <title>Re: Strange behaviour of  proc SQL + Proc CORR</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Strange-behaviour-of-proc-SQL-Proc-CORR/m-p/690675#M79665</link>
      <description>&lt;P&gt;Regarding PROC boundaries and ODS OUTPUT statement, the same concept is in play with other statements such as TITLE and FOOTNOTE.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 10 Oct 2020 14:09:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Strange-behaviour-of-proc-SQL-Proc-CORR/m-p/690675#M79665</guid>
      <dc:creator>RichardDeVen</dc:creator>
      <dc:date>2020-10-10T14:09:05Z</dc:date>
    </item>
  </channel>
</rss>

