<?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: Different order in code writing and log with WHERE clause in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Different-order-in-code-writing-and-log-with-WHERE-clause/m-p/726886#M225943</link>
    <description>&lt;P&gt;There is nothing wrong with the WHERE statement in the log. The reason for the reordering is SAS has to interpret your use of ranges -&amp;nbsp;&amp;nbsp;(4900:4949, 6000:6999) so has chosen to put the translation at&amp;nbsp; the end of the WHERE. The order of the WHERE components won't affect the result.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 16 Mar 2021 19:43:42 GMT</pubDate>
    <dc:creator>SASKiwi</dc:creator>
    <dc:date>2021-03-16T19:43:42Z</dc:date>
    <item>
      <title>Different order in code writing and log with WHERE clause</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Different-order-in-code-writing-and-log-with-WHERE-clause/m-p/726882#M225941</link>
      <description>&lt;P&gt;Hi all SAS Users,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I saw the difference in SAS order of code written and from the log as be low&lt;/P&gt;
&lt;P&gt;My code&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data filter;
	set var_cal;
	where (n(ajexdi,prccd_abs_,trfd)=3 or n(prccd_abs_,prchd,prcld)=3)
		and
		prccd_abs_ &amp;gt; 0
		and
		tpci='0'
		and
		(prcstd=3 or (prcstd=4 and LOC='CAN') or prcstd=10)
		and
&lt;STRONG&gt;		(input(SIC, 4.) not in (4900:4949, 6000:6999))
		and
		(raw_return&amp;lt;200)&lt;/STRONG&gt;
	;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The log is as below&lt;/P&gt;
&lt;PRE&gt;NOTE: There were 20150398 observations read from the data set WORK.VAR_CAL.
      WHERE ((N(ajexdi, prccd_abs_, trfd)=3) or (N(prccd_abs_, prchd, prcld)=3)) and (prccd_abs_&amp;gt;0) and (tpci='0') and (prcstd in 
      (3, 10) or ((prcstd=4) and (LOC='CAN'))) and &lt;STRONG&gt;(raw_return&amp;lt;200) and ((INPUT(SIC, 4.) not = INT(INPUT(SIC, 4.))) or  not 
      ((INPUT(SIC, 4.)&amp;gt;=4900 and INPUT(SIC, 4.)&amp;lt;=4949) or (INPUT(SIC, 4.)&amp;gt;=6000 and INPUT(SIC, 4.)&amp;lt;=6999)))&lt;/STRONG&gt;;&lt;/PRE&gt;
&lt;P&gt;As we can see from the code, raw_return &amp;lt;200 is at the last condition while in the log, the raw_return condition is not the last condition, it is quite strange to me.&lt;/P&gt;
&lt;P&gt;Could you please help me to sort it out?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Warm regards.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Mar 2021 19:30:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Different-order-in-code-writing-and-log-with-WHERE-clause/m-p/726882#M225941</guid>
      <dc:creator>Phil_NZ</dc:creator>
      <dc:date>2021-03-16T19:30:35Z</dc:date>
    </item>
    <item>
      <title>Re: Different order in code writing and log with WHERE clause</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Different-order-in-code-writing-and-log-with-WHERE-clause/m-p/726886#M225943</link>
      <description>&lt;P&gt;There is nothing wrong with the WHERE statement in the log. The reason for the reordering is SAS has to interpret your use of ranges -&amp;nbsp;&amp;nbsp;(4900:4949, 6000:6999) so has chosen to put the translation at&amp;nbsp; the end of the WHERE. The order of the WHERE components won't affect the result.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Mar 2021 19:43:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Different-order-in-code-writing-and-log-with-WHERE-clause/m-p/726886#M225943</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2021-03-16T19:43:42Z</dc:date>
    </item>
    <item>
      <title>Re: Different order in code writing and log with WHERE clause</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Different-order-in-code-writing-and-log-with-WHERE-clause/m-p/726893#M225945</link>
      <description>In general, SAS optimizes your code for processing and that's what you're seeing there. You'll often see notes such as "Interpreted mean as means". You can look at the SAS options for controlling what you see in the log - MSGLEVEL is one option, there are others. &lt;BR /&gt;</description>
      <pubDate>Tue, 16 Mar 2021 20:00:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Different-order-in-code-writing-and-log-with-WHERE-clause/m-p/726893#M225945</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-03-16T20:00:02Z</dc:date>
    </item>
  </channel>
</rss>

