<?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: To obtain the following using output using SQL in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/To-obtain-the-following-using-output-using-SQL/m-p/190776#M3965</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I wil surely tell.Its one of the question which my friend have asked.Ill ask him about the result.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 02 Dec 2014 08:06:21 GMT</pubDate>
    <dc:creator>venkatnaveen</dc:creator>
    <dc:date>2014-12-02T08:06:21Z</dc:date>
    <item>
      <title>To obtain the following using output using SQL</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/To-obtain-the-following-using-output-using-SQL/m-p/190772#M3961</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #141823; font-family: Helvetica, Arial, 'lucida grande', tahoma, verdana, arial, sans-serif; font-size: 14px; background-color: #ffffff;"&gt;i have a dataset like this&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #141823; font-family: Helvetica, Arial, 'lucida grande', tahoma, verdana, arial, sans-serif; font-size: 14px; background-color: #ffffff;"&gt;data test;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #141823; font-family: Helvetica, Arial, 'lucida grande', tahoma, verdana, arial, sans-serif; font-size: 14px; background-color: #ffffff;"&gt;input name$ rank;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #141823; font-family: Helvetica, Arial, 'lucida grande', tahoma, verdana, arial, sans-serif; font-size: 14px; background-color: #ffffff;"&gt;cards;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #141823; font-family: Helvetica, Arial, 'lucida grande', tahoma, verdana, arial, sans-serif; font-size: 14px; background-color: #ffffff;"&gt;a 1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #141823; font-family: Helvetica, Arial, 'lucida grande', tahoma, verdana, arial, sans-serif; font-size: 14px; background-color: #ffffff;"&gt;b 2&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #141823; font-family: Helvetica, Arial, 'lucida grande', tahoma, verdana, arial, sans-serif; font-size: 14px; background-color: #ffffff;"&gt;c 3&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #141823; font-family: Helvetica, Arial, 'lucida grande', tahoma, verdana, arial, sans-serif; font-size: 14px; background-color: #ffffff;"&gt;a 4&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #141823; font-family: Helvetica, Arial, 'lucida grande', tahoma, verdana, arial, sans-serif; font-size: 14px; background-color: #ffffff;"&gt;b 5&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #141823; font-family: Helvetica, Arial, 'lucida grande', tahoma, verdana, arial, sans-serif; font-size: 14px; background-color: #ffffff;"&gt;c 6&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #141823; font-family: Helvetica, Arial, 'lucida grande', tahoma, verdana, arial, sans-serif; font-size: 14px; background-color: #ffffff;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #141823; font-family: Helvetica, Arial, 'lucida grande', tahoma, verdana, arial, sans-serif; font-size: 14px; background-color: #ffffff;"&gt;i want o/p as three columns a,b,c and their rank sum like below through SQL only.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #141823; font-family: Helvetica, Arial, 'lucida grande', tahoma, verdana, arial, sans-serif; font-size: 14px; background-color: #ffffff;"&gt;a b c&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #141823; font-family: Helvetica, Arial, 'lucida grande', tahoma, verdana, arial, sans-serif; font-size: 14px; background-color: #ffffff;"&gt;5 7 9g &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 29 Nov 2014 17:48:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/To-obtain-the-following-using-output-using-SQL/m-p/190772#M3961</guid>
      <dc:creator>venkatnaveen</dc:creator>
      <dc:date>2014-11-29T17:48:26Z</dc:date>
    </item>
    <item>
      <title>Re: To obtain the following using output using SQL</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/To-obtain-the-following-using-output-using-SQL/m-p/190773#M3962</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This can be done, though it would be much easier using proc means or other SAS code.&amp;nbsp; &lt;/P&gt;&lt;P&gt;The SQL is manual so it's not really scalable at all so if you have more than 3 or 4 groups it will be tedious. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;/*solution requested*/&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New'; color: #011993;"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;sql&lt;/STRONG&gt;&lt;SPAN style="color: #000000;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New'; color: #0433ff;"&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="font-size: 10px; font-family: 'Courier New'; color: #0433ff;"&gt;select&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&amp;nbsp; sum(rank*(name=&lt;SPAN style="color: #942193;"&gt;'a'&lt;/SPAN&gt;)) &lt;SPAN style="color: #0433ff;"&gt;as&lt;/SPAN&gt; a,&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&amp;nbsp; sum(rank*(name=&lt;SPAN style="color: #942193;"&gt;'b'&lt;/SPAN&gt;)) &lt;SPAN style="color: #0433ff;"&gt;as&lt;/SPAN&gt; b,&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&amp;nbsp; sum(rank*(name=&lt;SPAN style="color: #942193;"&gt;'c'&lt;/SPAN&gt;)) &lt;SPAN style="color: #0433ff;"&gt;as&lt;/SPAN&gt; c&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&lt;SPAN style="color: #0433ff;"&gt;from&lt;/SPAN&gt; test;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New'; color: #011993;"&gt;&lt;STRONG&gt;quit&lt;/STRONG&gt;&lt;SPAN style="color: #000000;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;/*recommended solution*/&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New'; color: #011993;"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;sql&lt;/STRONG&gt;&lt;SPAN style="color: #000000;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&lt;SPAN style="color: #0433ff;"&gt;create&lt;/SPAN&gt; &lt;SPAN style="color: #0433ff;"&gt;table&lt;/SPAN&gt; want_temp &lt;SPAN style="color: #0433ff;"&gt;as&lt;/SPAN&gt; &lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&lt;SPAN style="color: #0433ff;"&gt;select&lt;/SPAN&gt; name, sum(rank) &lt;SPAN style="color: #0433ff;"&gt;as&lt;/SPAN&gt; total&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&lt;SPAN style="color: #0433ff;"&gt;from&lt;/SPAN&gt; test &lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&lt;SPAN style="color: #0433ff;"&gt;group&lt;/SPAN&gt; &lt;SPAN style="color: #0433ff;"&gt;by&lt;/SPAN&gt; name;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New'; color: #011993;"&gt;&lt;STRONG&gt;quit&lt;/STRONG&gt;&lt;SPAN style="color: #000000;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&lt;SPAN style="color: #011993;"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN style="color: #011993;"&gt;&lt;STRONG&gt;transpose&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN style="color: #0433ff;"&gt;data&lt;/SPAN&gt;=want_temp &lt;SPAN style="color: #0433ff;"&gt;out&lt;/SPAN&gt;=want2 (drop=_name_);&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&amp;nbsp; &lt;SPAN style="color: #0433ff;"&gt;id&lt;/SPAN&gt; name;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&amp;nbsp; &lt;SPAN style="color: #0433ff;"&gt;var&lt;/SPAN&gt; total;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New'; color: #011993;"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;SPAN style="color: #000000;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 29 Nov 2014 18:18:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/To-obtain-the-following-using-output-using-SQL/m-p/190773#M3962</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2014-11-29T18:18:37Z</dc:date>
    </item>
    <item>
      <title>Re: To obtain the following using output using SQL</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/To-obtain-the-following-using-output-using-SQL/m-p/190774#M3963</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks a lot Reeza.I wll try the second one.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 30 Nov 2014 03:59:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/To-obtain-the-following-using-output-using-SQL/m-p/190774#M3963</guid>
      <dc:creator>venkatnaveen</dc:creator>
      <dc:date>2014-11-30T03:59:56Z</dc:date>
    </item>
    <item>
      <title>Re: To obtain the following using output using SQL</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/To-obtain-the-following-using-output-using-SQL/m-p/190775#M3964</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, thanks &lt;STRONG style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;A _jive_internal="true" class="jiveTT-hover-user jive-username-link" data-avatarid="1002" data-externalid="" data-presence="null" data-userid="255172" data-username="Reeza" href="https://communities.sas.com/people/Reeza" id="jive-25517232835663669287186" style="padding: 0 3px 0 0; font-weight: inherit; font-style: inherit; font-size: 1.1em; font-family: inherit; color: #0e66ba;"&gt;Reeza&lt;/A&gt;&lt;/STRONG&gt;! &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;A _jive_internal="true" class="jiveTT-hover-user jive-username-link" data-avatarid="-1" data-externalid="" data-presence="null" data-userid="834992" data-username="venkatnaveen" href="https://communities.sas.com/people/venkatnaveen" id="jive-83499232835663715257186" style="padding: 0 3px 0 0; font-weight: inherit; font-style: inherit; font-size: 1.1em; font-family: inherit; color: #0e66ba;"&gt;venkatnaveen&lt;/A&gt;&lt;/STRONG&gt;, let us know how it worked for you as other community members may be in the same boat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anna&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Dec 2014 17:44:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/To-obtain-the-following-using-output-using-SQL/m-p/190775#M3964</guid>
      <dc:creator>AnnaBrown</dc:creator>
      <dc:date>2014-12-01T17:44:20Z</dc:date>
    </item>
    <item>
      <title>Re: To obtain the following using output using SQL</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/To-obtain-the-following-using-output-using-SQL/m-p/190776#M3965</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I wil surely tell.Its one of the question which my friend have asked.Ill ask him about the result.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Dec 2014 08:06:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/To-obtain-the-following-using-output-using-SQL/m-p/190776#M3965</guid>
      <dc:creator>venkatnaveen</dc:creator>
      <dc:date>2014-12-02T08:06:21Z</dc:date>
    </item>
  </channel>
</rss>

