<?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 Score bands in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Score-bands/m-p/729980#M227248</link>
    <description>&lt;P&gt;Hi, i need help in creating a new column which will be used to assign scores based on the&amp;nbsp; below bands:&lt;/P&gt;
&lt;P&gt;if qa_score &amp;lt; 90 then Score = 0&lt;/P&gt;
&lt;P&gt;if qa_score &amp;gt;= 90 and&amp;nbsp;qa_score &amp;lt; 92.5 then Score = 0.04&lt;/P&gt;
&lt;P&gt;if qa_score &amp;gt;= 92.5 and&amp;nbsp;qa_score &amp;lt; 95 then Score = 0.08&lt;/P&gt;
&lt;P&gt;if qa_score &amp;gt;= 95 and&amp;nbsp;qa_score &amp;lt; 97.5 then Score = 0.12&lt;/P&gt;
&lt;P&gt;if qa_score &amp;gt;= 97.5 and&amp;nbsp;qa_score &amp;lt; 100 then Score = 0.16&lt;/P&gt;
&lt;P&gt;if qa_score = 100 then Score = 0.20&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="sas"&gt;data have;
input policy_no QA_score;
datalines;
1 88 
2 91 
3 94 
4 96 
5 99
6 100 
;
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;data WANT&lt;/P&gt;
&lt;P&gt;policy_no&amp;nbsp; &amp;nbsp;Score&lt;/P&gt;
&lt;P&gt;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0&lt;/P&gt;
&lt;P&gt;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0.04&lt;/P&gt;
&lt;P&gt;3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0.08&lt;/P&gt;
&lt;P&gt;4&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0.12&lt;/P&gt;
&lt;P&gt;5&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0.16&lt;/P&gt;
&lt;P&gt;6&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0.20&lt;/P&gt;</description>
    <pubDate>Tue, 30 Mar 2021 06:46:17 GMT</pubDate>
    <dc:creator>Solly7</dc:creator>
    <dc:date>2021-03-30T06:46:17Z</dc:date>
    <item>
      <title>Score bands</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Score-bands/m-p/729980#M227248</link>
      <description>&lt;P&gt;Hi, i need help in creating a new column which will be used to assign scores based on the&amp;nbsp; below bands:&lt;/P&gt;
&lt;P&gt;if qa_score &amp;lt; 90 then Score = 0&lt;/P&gt;
&lt;P&gt;if qa_score &amp;gt;= 90 and&amp;nbsp;qa_score &amp;lt; 92.5 then Score = 0.04&lt;/P&gt;
&lt;P&gt;if qa_score &amp;gt;= 92.5 and&amp;nbsp;qa_score &amp;lt; 95 then Score = 0.08&lt;/P&gt;
&lt;P&gt;if qa_score &amp;gt;= 95 and&amp;nbsp;qa_score &amp;lt; 97.5 then Score = 0.12&lt;/P&gt;
&lt;P&gt;if qa_score &amp;gt;= 97.5 and&amp;nbsp;qa_score &amp;lt; 100 then Score = 0.16&lt;/P&gt;
&lt;P&gt;if qa_score = 100 then Score = 0.20&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="sas"&gt;data have;
input policy_no QA_score;
datalines;
1 88 
2 91 
3 94 
4 96 
5 99
6 100 
;
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;data WANT&lt;/P&gt;
&lt;P&gt;policy_no&amp;nbsp; &amp;nbsp;Score&lt;/P&gt;
&lt;P&gt;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0&lt;/P&gt;
&lt;P&gt;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0.04&lt;/P&gt;
&lt;P&gt;3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0.08&lt;/P&gt;
&lt;P&gt;4&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0.12&lt;/P&gt;
&lt;P&gt;5&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0.16&lt;/P&gt;
&lt;P&gt;6&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0.20&lt;/P&gt;</description>
      <pubDate>Tue, 30 Mar 2021 06:46:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Score-bands/m-p/729980#M227248</guid>
      <dc:creator>Solly7</dc:creator>
      <dc:date>2021-03-30T06:46:17Z</dc:date>
    </item>
    <item>
      <title>Re: Score bands</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Score-bands/m-p/729981#M227249</link>
      <description>&lt;P&gt;Sorry, but i don't see the problem. You have already posted the necessary statements to create the variable "score", so: what is the problem?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Using a format instead of if-statements is recommended, but this is up to you.&lt;/P&gt;</description>
      <pubDate>Tue, 30 Mar 2021 06:55:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Score-bands/m-p/729981#M227249</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2021-03-30T06:55:48Z</dc:date>
    </item>
    <item>
      <title>Re: Score bands</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Score-bands/m-p/729983#M227251</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;
   invalue s
      low  -&amp;lt; 90   = 0
      90   -&amp;lt; 92.5 = 0.04
      92.5 -&amp;lt; 95   = 0.08
      95   -&amp;lt; 97.5 = 0.12
      97.5 -&amp;lt; 100  = 0.16
      100  - high = 0.2
   ;
run;

data have;
input policy_no QA_score;
datalines;
1 88  
2 91  
3 94  
4 96  
5 99  
6 100 
;

data want;
   set have;
   score = input(QA_score, s.);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 30 Mar 2021 06:59:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Score-bands/m-p/729983#M227251</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2021-03-30T06:59:07Z</dc:date>
    </item>
    <item>
      <title>Re: Score bands</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Score-bands/m-p/729984#M227252</link>
      <description>&lt;P&gt;If you want to make it shorter, you can use the following code.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  set have;
  if      qa_score &amp;lt; 90   then Score = 0;
  else if qa_score &amp;lt; 92.5 then Score = 0.04;
  else if qa_score &amp;lt; 95   then Score = 0.08;
  else if qa_score &amp;lt; 97.5 then Score = 0.12;
  else if qa_score &amp;lt; 100  then Score = 0.16;
  else if qa_score = 100  then Score = 0.20;
  drop qa_score;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 30 Mar 2021 06:59:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Score-bands/m-p/729984#M227252</guid>
      <dc:creator>japelin</dc:creator>
      <dc:date>2021-03-30T06:59:14Z</dc:date>
    </item>
    <item>
      <title>Re: Score bands</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Score-bands/m-p/730063#M227290</link>
      <description>Thank you, it works perfectly fine.</description>
      <pubDate>Tue, 30 Mar 2021 12:22:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Score-bands/m-p/730063#M227290</guid>
      <dc:creator>Solly7</dc:creator>
      <dc:date>2021-03-30T12:22:48Z</dc:date>
    </item>
    <item>
      <title>Re: Score bands</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Score-bands/m-p/730095#M227297</link>
      <description>&lt;P&gt;Anytime.&lt;/P&gt;</description>
      <pubDate>Tue, 30 Mar 2021 14:01:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Score-bands/m-p/730095#M227297</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2021-03-30T14:01:36Z</dc:date>
    </item>
  </channel>
</rss>

