<?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: SAS Help in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/SAS-Help/m-p/110421#M30662</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Might one user have more than two rates? What then?&lt;/P&gt;&lt;P&gt;Should the result columns be in the order of the incoming data or ascending value? (as the original, very small, example demonstrates)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 14 Aug 2013 10:46:53 GMT</pubDate>
    <dc:creator>Peter_C</dc:creator>
    <dc:date>2013-08-14T10:46:53Z</dc:date>
    <item>
      <title>SAS Help</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-Help/m-p/110418#M30659</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have the sas dataset like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;User Rate&lt;/P&gt;&lt;P&gt;A&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4&lt;/P&gt;&lt;P&gt;A&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4&lt;/P&gt;&lt;P&gt;A&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 5&lt;/P&gt;&lt;P&gt;A&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 5&lt;/P&gt;&lt;P&gt;B&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2&lt;/P&gt;&lt;P&gt;B&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2&lt;/P&gt;&lt;P&gt;B&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to output :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;User Rate1&amp;nbsp; Rate2&lt;/P&gt;&lt;P&gt;A&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 5&lt;/P&gt;&lt;P&gt;B&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kindly advise.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SK&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Aug 2013 06:26:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-Help/m-p/110418#M30659</guid>
      <dc:creator>Siddharth123</dc:creator>
      <dc:date>2013-08-14T06:26:43Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Help</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-Help/m-p/110419#M30660</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You could solve this with data step programming using SET - BY, and using first./last.-logic and explicit OUTPUT.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Aug 2013 07:16:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-Help/m-p/110419#M30660</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2013-08-14T07:16:31Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Help</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-Help/m-p/110420#M30661</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Proc SQL qould be good here.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; data one;&lt;/P&gt;&lt;P&gt;input user1 $ rate;&lt;/P&gt;&lt;P&gt;datalines;&lt;/P&gt;&lt;P&gt;A 4&lt;/P&gt;&lt;P&gt;A 4&lt;/P&gt;&lt;P&gt;A 5&lt;/P&gt;&lt;P&gt;A 5&lt;/P&gt;&lt;P&gt;B 2&lt;/P&gt;&lt;P&gt;B 2&lt;/P&gt;&lt;P&gt;B 3&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;/* precautionary sort */&lt;/P&gt;&lt;P&gt;proc sort data=one;&lt;/P&gt;&lt;P&gt;by user1, rate;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;create table two as&lt;/P&gt;&lt;P&gt;select&lt;/P&gt;&lt;P&gt;max(rate) as rate1,&lt;/P&gt;&lt;P&gt;min(rate as rate2&lt;/P&gt;&lt;P&gt;from one&lt;/P&gt;&lt;P&gt;group by user1;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Should give desired output.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Aug 2013 07:24:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-Help/m-p/110420#M30661</guid>
      <dc:creator>Murray_Court</dc:creator>
      <dc:date>2013-08-14T07:24:37Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Help</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-Help/m-p/110421#M30662</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Might one user have more than two rates? What then?&lt;/P&gt;&lt;P&gt;Should the result columns be in the order of the incoming data or ascending value? (as the original, very small, example demonstrates)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Aug 2013 10:46:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-Help/m-p/110421#M30662</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2013-08-14T10:46:53Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Help</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-Help/m-p/110422#M30663</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Siddharth!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have been using SAS for few months now so I am not the most experienced user. Even though there must be a more efficient way, here is what I have for you... Does this work? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/*I arbitrarily added a few more values to test*/&lt;/P&gt;&lt;P&gt;data one;&lt;/P&gt;&lt;P&gt;input user1 $ rate;&lt;/P&gt;&lt;P&gt;datalines;&lt;/P&gt;&lt;P&gt;A 4&lt;/P&gt;&lt;P&gt;A 4&lt;/P&gt;&lt;P&gt;A 5&lt;/P&gt;&lt;P&gt;A 5&lt;/P&gt;&lt;P&gt;A 2&lt;/P&gt;&lt;P&gt;A 1&lt;/P&gt;&lt;P&gt;A 6&lt;/P&gt;&lt;P&gt;A 3&lt;/P&gt;&lt;P&gt;A 5&lt;/P&gt;&lt;P&gt;A 4&lt;/P&gt;&lt;P&gt;B 2&lt;/P&gt;&lt;P&gt;B 2&lt;/P&gt;&lt;P&gt;B 3&lt;/P&gt;&lt;P&gt;B 5&lt;/P&gt;&lt;P&gt;B 6&lt;/P&gt;&lt;P&gt;B 8&lt;/P&gt;&lt;P&gt;B 6&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/*Sort the data by rate so that there are no duplicate values on the same letter */&lt;/P&gt;&lt;P&gt;proc sort data=one nodup;&lt;/P&gt;&lt;P&gt;by rate;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/*sort the data again by User1 to be able to transpose in the next step*/&lt;/P&gt;&lt;P&gt;proc sort data=one;&lt;/P&gt;&lt;P&gt;by user1;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/*Transpose and create a new data set*/&lt;/P&gt;&lt;P&gt;proc transpose data=one out=transposed;&lt;/P&gt;&lt;P&gt;by user1;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/*Print to check the results*/&lt;/P&gt;&lt;P&gt;proc print data=transposed;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Aug 2013 12:32:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-Help/m-p/110422#M30663</guid>
      <dc:creator>Greek</dc:creator>
      <dc:date>2013-08-14T12:32:57Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Help</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-Help/m-p/110423#M30664</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The approach proposed by Greek, using Proc Transpose, is the most generic way of handling this.&amp;nbsp; It will handle many conditions, such as the number of values and level of the values, that you will need to consider programmatically if using either data step or sql.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also it is very efficient -- does its work in memory.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Larry &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Aug 2013 14:18:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-Help/m-p/110423#M30664</guid>
      <dc:creator>LarryWorley</dc:creator>
      <dc:date>2013-08-14T14:18:46Z</dc:date>
    </item>
  </channel>
</rss>

