<?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 in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Proc-sql/m-p/384290#M65641</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/144247"&gt;@shivamarrora0&lt;/a&gt; wrote:&lt;BR /&gt;Hi, I wanted to know the reason why b.sal le a.sal&lt;BR /&gt;comparing 1 observation of B table to every observation of A table .. ?&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This would one approach to "how many salary values are the same or more than the person with the givend ID, including that person".&lt;/P&gt;
&lt;P&gt;Is a "what" answer.&amp;nbsp; Why is up to your rules.&lt;/P&gt;</description>
    <pubDate>Mon, 31 Jul 2017 14:48:43 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2017-07-31T14:48:43Z</dc:date>
    <item>
      <title>Proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-sql/m-p/384094#M65629</link>
      <description>&lt;P&gt;Hi All, can you please explain crisply how the below query is working,&lt;/P&gt;&lt;P&gt;i wanted to know how where confition checking the each observtion of table b with every observation of table a.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/* Quesry is used to find the ranks*/&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data a;&lt;BR /&gt;input id sal;&lt;BR /&gt;cards;&lt;BR /&gt;1 100&lt;BR /&gt;2 200&lt;BR /&gt;3 300&lt;BR /&gt;9 78&lt;BR /&gt;10 890&lt;BR /&gt;11 890&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt;select a.*,(select count(distinct sal) from a where b.sal le a.sal) as r from a b;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 30 Jul 2017 18:29:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-sql/m-p/384094#M65629</guid>
      <dc:creator>shivamarrora0</dc:creator>
      <dc:date>2017-07-30T18:29:07Z</dc:date>
    </item>
    <item>
      <title>Re: Proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-sql/m-p/384122#M65631</link>
      <description>&lt;P&gt;Quite simply a and b are the same table which you are joining with itself - b is just an alias for a which is set up by the "from a b" portion of the query.&lt;/P&gt;</description>
      <pubDate>Sun, 30 Jul 2017 23:35:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-sql/m-p/384122#M65631</guid>
      <dc:creator>ChrisBrooks</dc:creator>
      <dc:date>2017-07-30T23:35:52Z</dc:date>
    </item>
    <item>
      <title>Re: Proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-sql/m-p/384130#M65632</link>
      <description>&lt;P&gt;Conceptually, SAS is running a subquery for every observation of table a. Since that subquery also involves table a, you must give the table an alias name (b) so as to allow an expression like "b.sal le a.sal". I think the query should be written as&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
select 
	b.*,
	(	select 
			count(distinct id) 
		from a 
		where b.sal le a.sal	) as r 
from a as b;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 31 Jul 2017 01:38:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-sql/m-p/384130#M65632</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2017-07-31T01:38:04Z</dc:date>
    </item>
    <item>
      <title>Re: Proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-sql/m-p/384153#M65633</link>
      <description>Hi, I wanted to know the reason why b.sal le a.sal&lt;BR /&gt;comparing 1 observation of B table to every observation of A table .. ?</description>
      <pubDate>Mon, 31 Jul 2017 04:59:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-sql/m-p/384153#M65633</guid>
      <dc:creator>shivamarrora0</dc:creator>
      <dc:date>2017-07-31T04:59:32Z</dc:date>
    </item>
    <item>
      <title>Re: Proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-sql/m-p/384164#M65634</link>
      <description>Well, it's your program and your data, so basically you should know better than us what this program's task is.</description>
      <pubDate>Mon, 31 Jul 2017 06:25:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-sql/m-p/384164#M65634</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2017-07-31T06:25:09Z</dc:date>
    </item>
    <item>
      <title>Re: Proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-sql/m-p/384290#M65641</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/144247"&gt;@shivamarrora0&lt;/a&gt; wrote:&lt;BR /&gt;Hi, I wanted to know the reason why b.sal le a.sal&lt;BR /&gt;comparing 1 observation of B table to every observation of A table .. ?&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This would one approach to "how many salary values are the same or more than the person with the givend ID, including that person".&lt;/P&gt;
&lt;P&gt;Is a "what" answer.&amp;nbsp; Why is up to your rules.&lt;/P&gt;</description>
      <pubDate>Mon, 31 Jul 2017 14:48:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-sql/m-p/384290#M65641</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-07-31T14:48:43Z</dc:date>
    </item>
  </channel>
</rss>

