<?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 Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/PROC-SQL/m-p/488453#M127317</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
create table want as
select
  a.*,
  case
    when amount &amp;lt; 100 then 'A'
    when 100 &amp;lt;= amount &amp;lt;= 200 then 'B'
    when amount &amp;gt; 200 then 'C'
  end as category
from have a;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 21 Aug 2018 08:38:31 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2018-08-21T08:38:31Z</dc:date>
    <item>
      <title>PROC SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-SQL/m-p/488451#M127315</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;I have got a data with 20 columns and i want categorize the data using Proc SQL as per below&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If Amount spent is less than 100 than "A"&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If Amount spent is&amp;nbsp;between 100 and 200 than "B"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If Amount spent is&amp;nbsp;greater than 200&amp;nbsp;than "C"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Aug 2018 08:25:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-SQL/m-p/488451#M127315</guid>
      <dc:creator>Vaibhav_Kalra</dc:creator>
      <dc:date>2018-08-21T08:25:44Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-SQL/m-p/488452#M127316</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;use the case Expression as explained &lt;A href="http://support.sas.com/documentation/cdl/en/sqlproc/63043/HTML/default/viewer.htm#n0a85s0ijz65irn1h3jtariooea5.htm" target="_blank"&gt;here&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Aug 2018 08:38:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-SQL/m-p/488452#M127316</guid>
      <dc:creator>Oligolas</dc:creator>
      <dc:date>2018-08-21T08:38:14Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-SQL/m-p/488453#M127317</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
create table want as
select
  a.*,
  case
    when amount &amp;lt; 100 then 'A'
    when 100 &amp;lt;= amount &amp;lt;= 200 then 'B'
    when amount &amp;gt; 200 then 'C'
  end as category
from have a;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 21 Aug 2018 08:38:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-SQL/m-p/488453#M127317</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-08-21T08:38:31Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-SQL/m-p/488464#M127321</link>
      <description>&lt;P&gt;Please post test data in the form of a datastep:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And what you want to see out at the end, otherwise we are guessing on both.&amp;nbsp; You say you have 20 columns, but never mention what these are, how they are used or any relevance to the code.&amp;nbsp; You state using SQL, but do not give any reasons for this - SQL is built to run on normalised data - i.e. few columns, lots of observations - and as such isn't a good tool for lots of columns.&amp;nbsp; Datastep and an array would be easier - obviously&amp;nbsp; still guessing as no information provided.&amp;nbsp; Its likely that you could just format the value with a custom format and avoid all conditional programming at all.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Aug 2018 09:09:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-SQL/m-p/488464#M127321</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-08-21T09:09:17Z</dc:date>
    </item>
  </channel>
</rss>

