<?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 help in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/proc-sql-help/m-p/413709#M101287</link>
    <description>&lt;P&gt;And Merge By is a form of Full Outer&amp;nbsp;Join using the by variables in an ON clause.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However to exactly match merge behavior may require a lot of additional code to replicate the way merge results in the values for the non-explicitly named variables where the values for the second named dataset replace those of the first named when the by variables match.&lt;/P&gt;</description>
    <pubDate>Wed, 15 Nov 2017 15:53:00 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2017-11-15T15:53:00Z</dc:date>
    <item>
      <title>proc sql help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-sql-help/m-p/413670#M101278</link>
      <description>&lt;P&gt;Can someone help me to convert this code in proc sql &amp;nbsp;please?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data one;&lt;BR /&gt;merge one two;&lt;BR /&gt;by variable1&amp;nbsp;variable2 ;&lt;BR /&gt;if sum_1=. then sum_1=0;&lt;BR /&gt;balance=sum_2+sum_1;&lt;BR /&gt;if balance&amp;nbsp;&amp;gt; 5000 and date eq today() or date2&amp;nbsp;eq today() &amp;nbsp;;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks in advance.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Nov 2017 14:55:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-sql-help/m-p/413670#M101278</guid>
      <dc:creator>buddha_d</dc:creator>
      <dc:date>2017-11-15T14:55:02Z</dc:date>
    </item>
    <item>
      <title>Re: proc sql help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-sql-help/m-p/413681#M101280</link>
      <description>&lt;P&gt;Can I ask why exactly?&amp;nbsp; Its just your posting a few of these, can we convert SAS code into SQL code for you posts now.&amp;nbsp; There is not technical reason why you would&amp;nbsp;&lt;U&gt;&lt;STRONG&gt;need&lt;/STRONG&gt;&lt;/U&gt; to convert these, unless you are passing it through to a database - in which case you should look at the database specific SQL functions.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this is purely for your preference, then perhaps its a good task for&amp;nbsp;&lt;STRONG&gt;you&lt;/STRONG&gt; to convert this code to SQL, and come back with any questions you might have, this is a Q&amp;amp;A remember not a contract work site.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For guidance, case &amp;lt;&amp;gt; when &amp;lt;&amp;gt; else &amp;lt;&amp;gt; end, is equivant to if statements, and the last if statement is equivalent to a where clause.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Nov 2017 15:20:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-sql-help/m-p/413681#M101280</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-11-15T15:20:13Z</dc:date>
    </item>
    <item>
      <title>Re: proc sql help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-sql-help/m-p/413706#M101286</link>
      <description>&lt;P&gt;RW9, Thanks for your response. I am not getting the same outputs. I am not using case when correctly I believe. could you please check it and let me know where I am messing it up.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt;create table one1 as&lt;BR /&gt;select a.*,b.*, case sum_1 when sum_1=. then sum_1=0 else sum_1 end as sum_1, (a.sum_1+b.sum_2) as difference&lt;BR /&gt;from one a, two b&lt;BR /&gt;where (a.variable1=b.variable1) and (a.variable2=b.variable2) and (calculated difference &amp;gt;5000) and (date eq today() or date2 eq today()) ; quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks in advance.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Nov 2017 15:50:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-sql-help/m-p/413706#M101286</guid>
      <dc:creator>buddha_d</dc:creator>
      <dc:date>2017-11-15T15:50:45Z</dc:date>
    </item>
    <item>
      <title>Re: proc sql help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-sql-help/m-p/413709#M101287</link>
      <description>&lt;P&gt;And Merge By is a form of Full Outer&amp;nbsp;Join using the by variables in an ON clause.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However to exactly match merge behavior may require a lot of additional code to replicate the way merge results in the values for the non-explicitly named variables where the values for the second named dataset replace those of the first named when the by variables match.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Nov 2017 15:53:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-sql-help/m-p/413709#M101287</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-11-15T15:53:00Z</dc:date>
    </item>
    <item>
      <title>Re: proc sql help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-sql-help/m-p/413718#M101290</link>
      <description>&lt;P&gt;Is my case when statement good as for as my code is concerned?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Nov 2017 16:10:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-sql-help/m-p/413718#M101290</guid>
      <dc:creator>buddha_d</dc:creator>
      <dc:date>2017-11-15T16:10:25Z</dc:date>
    </item>
    <item>
      <title>Re: proc sql help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-sql-help/m-p/413728#M101295</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It should look like:&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;case when sum_1=. then 0 else sum_1 end as sum_1, &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;(a.sum_1+b.sum_2) as difference&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Nov 2017 16:31:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-sql-help/m-p/413728#M101295</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-11-15T16:31:12Z</dc:date>
    </item>
    <item>
      <title>Re: proc sql help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-sql-help/m-p/413731#M101297</link>
      <description>&lt;P&gt;Sorry, I didn't check RW9 response for case when statement. Let me try that.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Nov 2017 16:39:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-sql-help/m-p/413731#M101297</guid>
      <dc:creator>buddha_d</dc:creator>
      <dc:date>2017-11-15T16:39:22Z</dc:date>
    </item>
  </channel>
</rss>

