<?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 Urvish Shah in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Urvish-Shah/m-p/35858#M8911</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Art.T&lt;/P&gt;&lt;P&gt;I must have to say using monotonic() is dangerous for proc sql, this has been mentioned in sas documentation.&lt;/P&gt;&lt;P&gt;It will result undesirable result,especially for complex SQL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ksharp&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 25 Jul 2011 07:18:37 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2011-07-25T07:18:37Z</dc:date>
    <item>
      <title>Urvish Shah</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Urvish-Shah/m-p/35850#M8903</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello &lt;/P&gt;&lt;P&gt;I have the data like this &lt;/P&gt;&lt;P&gt;Data have;&lt;/P&gt;&lt;P&gt;input name $ age;&lt;/P&gt;&lt;P&gt;cards;&lt;/P&gt;&lt;P&gt;A 20 &lt;/P&gt;&lt;P&gt;A 21&lt;/P&gt;&lt;P&gt;B 22&lt;/P&gt;&lt;P&gt;C 23&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;nw i wan to eliminate the duplicate obs like this &lt;/P&gt;&lt;P&gt;proc sort data = have nodupkey;&lt;/P&gt;&lt;P&gt;by name;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;nw is there any other way to do the same by using Proc Sql in order to reduce the processing time &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 24 Jul 2011 05:26:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Urvish-Shah/m-p/35850#M8903</guid>
      <dc:creator>UrvishShah</dc:creator>
      <dc:date>2011-07-24T05:26:34Z</dc:date>
    </item>
    <item>
      <title>Urvish Shah</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Urvish-Shah/m-p/35851#M8904</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You could always use select distint(name) as onename,age, in a proc sql call, but I doubt if it would improve the processing time.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 24 Jul 2011 14:36:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Urvish-Shah/m-p/35851#M8904</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2011-07-24T14:36:21Z</dc:date>
    </item>
    <item>
      <title>Urvish Shah</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Urvish-Shah/m-p/35852#M8905</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Urvish,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First, it helps the rest of us if you use the topic of your question as the subject (rather than your name).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use the DISTINCT option in SQL for this.&amp;nbsp; Documentation in the manual.&amp;nbsp; Also search the SAS papers for NODUPKEY and DISTINCT to find some good descriptions of their use.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Be aware, SQL is not always faster and may not provide the same results (you should get the same number of record, but not necesssarily the same records). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Doc Muhlbaier&lt;/P&gt;&lt;P&gt;Duke&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 24 Jul 2011 14:37:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Urvish-Shah/m-p/35852#M8905</guid>
      <dc:creator>Doc_Duke</dc:creator>
      <dc:date>2011-07-24T14:37:33Z</dc:date>
    </item>
    <item>
      <title>Urvish Shah</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Urvish-Shah/m-p/35853#M8906</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;All four rows in the example are different, so DISTINCT is going to return all four.&lt;/P&gt;&lt;PRE __jive_macro_name="quote" class="jive_text_macro jive_macro_quote"&gt;&lt;P&gt;UrvishShah wrote:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV class="jive-rendered-content"&gt;&lt;P&gt;Hello &lt;/P&gt;&lt;P&gt;I have the data like this &lt;/P&gt;&lt;P&gt;Data have;&lt;/P&gt;&lt;P&gt;input name $ age;&lt;/P&gt;&lt;P&gt;cards;&lt;/P&gt;&lt;P&gt;A 20 &lt;/P&gt;&lt;P&gt;A 21&lt;/P&gt;&lt;P&gt;B 22&lt;/P&gt;&lt;P&gt;C 23&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;nw i wan to eliminate the duplicate obs like this &lt;/P&gt;&lt;P&gt;proc sort data = have nodupkey;&lt;/P&gt;&lt;P&gt;by name;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;nw is there any other way to do the same by using Proc Sql in order to reduce the processing time &lt;/P&gt;&lt;/DIV&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 24 Jul 2011 23:09:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Urvish-Shah/m-p/35853#M8906</guid>
      <dc:creator>Howles</dc:creator>
      <dc:date>2011-07-24T23:09:39Z</dc:date>
    </item>
    <item>
      <title>Urvish Shah</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Urvish-Shah/m-p/35854#M8907</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Howard,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Not if one first selects just based on name (e.g.)&lt;/P&gt;&lt;P&gt;proc sql noprint;&lt;/P&gt;&lt;P&gt;&amp;nbsp; create table want as&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; select distinct(name) as onename&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; from have&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; group by name&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; having count(*) gt 0&lt;/P&gt;&lt;P&gt; ;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and then joins the result back with the original table.&amp;nbsp; However, as mentioned, I can't see it outperforming proc sort.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Jul 2011 01:27:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Urvish-Shah/m-p/35854#M8907</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2011-07-25T01:27:57Z</dc:date>
    </item>
    <item>
      <title>Urvish Shah</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Urvish-Shah/m-p/35855#M8908</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Seems to me that you can omit the GROUP BY and HAVING clauses and get the same WANT; the HAVING condition can never be false. Then joining this result to the original will get you back to ... the original.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will work as long as there are no ties:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier New; color: #0000ff;"&gt;&lt;SPAN style="color: #000000;"&gt;&amp;nbsp; &lt;/SPAN&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="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier New;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #0000ff;"&gt;select&lt;/SPAN&gt; *&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier New;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #0000ff;"&gt;from&lt;/SPAN&gt; have&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier New;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #0000ff;"&gt;group&lt;/SPAN&gt; &lt;SPAN style="color: #0000ff;"&gt;by&lt;/SPAN&gt; name&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier New;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; having age EQ max(age)&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier New;"&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __jive_macro_name="quote" class="jive_text_macro jive_macro_quote"&gt;&lt;P&gt;art297 wrote:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Howard,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Not if one first selects just based on name (e.g.)&lt;/P&gt;&lt;P&gt;proc sql noprint;&lt;/P&gt;&lt;P&gt;&amp;nbsp; create table want as&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; select distinct(name) as onename&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; from have&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; group by name&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; having count(*) gt 0&lt;/P&gt;&lt;P&gt; ;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and then joins the result back with the original table.&amp;nbsp; However, as mentioned, I can't see it outperforming proc sort.&lt;/P&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Jul 2011 02:04:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Urvish-Shah/m-p/35855#M8908</guid>
      <dc:creator>Howles</dc:creator>
      <dc:date>2011-07-25T02:04:35Z</dc:date>
    </item>
    <item>
      <title>Urvish Shah</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Urvish-Shah/m-p/35856#M8909</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Howard,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The following will work with or without ties, but uses the undocumented monotonic function:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data have;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input name $ age;&lt;/P&gt;&lt;P&gt;&amp;nbsp; cards;&lt;/P&gt;&lt;P&gt;A 20&lt;/P&gt;&lt;P&gt;A 20&lt;/P&gt;&lt;P&gt;A 21&lt;/P&gt;&lt;P&gt;B 22&lt;/P&gt;&lt;P&gt;C 23&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;proc sql noprint;&lt;/P&gt;&lt;P&gt;&amp;nbsp; create table want as&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; select distinct(name) as onename&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; from have&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; group by name&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; having min(monotonic()) gt 0&lt;/P&gt;&lt;P&gt; ;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But, I still don't see it necessarily working any faster than using proc sort.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Jul 2011 02:35:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Urvish-Shah/m-p/35856#M8909</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2011-07-25T02:35:01Z</dc:date>
    </item>
    <item>
      <title>Urvish Shah</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Urvish-Shah/m-p/35857#M8910</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Sorry to all for displaying my name insted of the original topic &lt;/P&gt;&lt;P&gt;I am really sorry for that &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After posted my question i learned a lot .&lt;/P&gt;&lt;P&gt;Thanks all .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Jul 2011 06:00:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Urvish-Shah/m-p/35857#M8910</guid>
      <dc:creator>UrvishShah</dc:creator>
      <dc:date>2011-07-25T06:00:14Z</dc:date>
    </item>
    <item>
      <title>Urvish Shah</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Urvish-Shah/m-p/35858#M8911</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Art.T&lt;/P&gt;&lt;P&gt;I must have to say using monotonic() is dangerous for proc sql, this has been mentioned in sas documentation.&lt;/P&gt;&lt;P&gt;It will result undesirable result,especially for complex SQL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ksharp&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Jul 2011 07:18:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Urvish-Shah/m-p/35858#M8911</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2011-07-25T07:18:37Z</dc:date>
    </item>
    <item>
      <title>Urvish Shah</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Urvish-Shah/m-p/35859#M8912</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm pretty sure that MONOTONIC always returns positive values, so the HAVING and GROUP BY clauses here don't do anything.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DISTINCT is not a function, so the parens around NAME also have no effect.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We still need the AGE column to emulate the SORT/NODUPKEY results. This&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier New; color: #0000ff;"&gt;&lt;SPAN style="color: #000000;"&gt;&amp;nbsp; &lt;/SPAN&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="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier New;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #0000ff;"&gt;select&lt;/SPAN&gt; name , max(age) &lt;SPAN style="color: #0000ff;"&gt;as&lt;/SPAN&gt; age&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier New;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #0000ff;"&gt;from&lt;/SPAN&gt; have&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier New;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #0000ff;"&gt;group&lt;/SPAN&gt; &lt;SPAN style="color: #0000ff;"&gt;by&lt;/SPAN&gt; name&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier New;"&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but only in the special case of a single satellite column. Were there multiple satellite columns (like AGE and SEX), no go.&lt;/P&gt;&lt;PRE __jive_macro_name="quote" class="jive_text_macro jive_macro_quote"&gt;&lt;P&gt;art297 wrote:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Howard,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The following will work with or without ties, but uses the undocumented monotonic function:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data have;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input name $ age;&lt;/P&gt;&lt;P&gt;&amp;nbsp; cards;&lt;/P&gt;&lt;P&gt;A 20&lt;/P&gt;&lt;P&gt;A 20&lt;/P&gt;&lt;P&gt;A 21&lt;/P&gt;&lt;P&gt;B 22&lt;/P&gt;&lt;P&gt;C 23&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;proc sql noprint;&lt;/P&gt;&lt;P&gt;&amp;nbsp; create table want as&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; select distinct(name) as onename&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; from have&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; group by name&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; having min(monotonic()) gt 0&lt;/P&gt;&lt;P&gt; ;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But, I still don't see it necessarily working any faster than using proc sort.&lt;/P&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Jul 2011 22:14:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Urvish-Shah/m-p/35859#M8912</guid>
      <dc:creator>Howles</dc:creator>
      <dc:date>2011-07-25T22:14:49Z</dc:date>
    </item>
  </channel>
</rss>

