<?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: Null values on bands in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Null-values-on-bands/m-p/763462#M241795</link>
    <description>Thanks a lot Patrick..your solutions works!</description>
    <pubDate>Tue, 24 Aug 2021 08:55:07 GMT</pubDate>
    <dc:creator>Solly7</dc:creator>
    <dc:date>2021-08-24T08:55:07Z</dc:date>
    <item>
      <title>Null values on bands</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Null-values-on-bands/m-p/763454#M241788</link>
      <description>&lt;P&gt;Hi, i need help in allocating score bands to the corresponding save_ratio.. i tried the below code but it returns null values 'dot' in the output&amp;nbsp; "Saves_Ratio_Score'&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data retentions;
  input Save_Ratio user : $20. Band_Indicator $;
  datalines;
0.45 ALUPIYA I
0.37 DLOUIS I
0.6 DMORAKE I
0.30 FDANISA O
0.50 FFARAO O
;

proc format;
   invalue inbound_ratio_band
      low  -&amp;lt; 0.35   = 0
      0.35 -&amp;lt; 0.43 = 0.08
      0.43 -&amp;lt; 0.473   = 0.16
      0.473 -&amp;lt; 0.52 = 0.24
      0.52 -&amp;lt; 0.59  = 0.32
      0.59 - high = 0.4
   ;
run;

proc format;
   invalue outbound_ratio_band
      low  -&amp;lt; 0.34   = 0
      0.34 -&amp;lt; 0.41 = 0.08
      0.41 -&amp;lt; 0.45   = 0.16
      0.45 -&amp;lt; 0.5 = 0.24
      0.5  -&amp;lt; 0.56 = 0.32
      0.56  - high = 0.4
   ;
run;

data fix_bands;
    SET retentions;
	IF	UPCASE(Band_Indicator)	=	'I'	THEN
		Saves_Ratio_Score	= INPUT(Save_Ratio,Inbound_ratio_band.);
	ELSE
	IF	UPCASE(Band_Indicator)	=	'O'	THEN
		Saves_Ratio_Score	= INPUT(Save_Ratio,Outbound_ratio_band.);
	CALL	MISSING(Saves_Ratio_Score);
run;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Aug 2021 08:33:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Null-values-on-bands/m-p/763454#M241788</guid>
      <dc:creator>Solly7</dc:creator>
      <dc:date>2021-08-24T08:33:36Z</dc:date>
    </item>
    <item>
      <title>Re: Null values on bands</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Null-values-on-bands/m-p/763456#M241789</link>
      <description>I added ELSE after the last THEN..but it still dont work&lt;BR /&gt;&lt;BR /&gt;data fix_bands;&lt;BR /&gt;    SET retentions;&lt;BR /&gt;	IF	UPCASE(Band_Indicator)	=	'I'	THEN&lt;BR /&gt;		Saves_Ratio_Score	= INPUT(Save_Ratio,Inbound_ratio_band.);&lt;BR /&gt;	ELSE&lt;BR /&gt;	IF	UPCASE(Band_Indicator)	=	'O'	THEN&lt;BR /&gt;		Saves_Ratio_Score	= INPUT(Save_Ratio,Outbound_ratio_band.);&lt;BR /&gt;       ELSE&lt;BR /&gt;	CALL	MISSING(Saves_Ratio_Score);&lt;BR /&gt;run;</description>
      <pubDate>Tue, 24 Aug 2021 08:37:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Null-values-on-bands/m-p/763456#M241789</guid>
      <dc:creator>Solly7</dc:creator>
      <dc:date>2021-08-24T08:37:11Z</dc:date>
    </item>
    <item>
      <title>Re: Null values on bands</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Null-values-on-bands/m-p/763458#M241791</link>
      <description>&lt;P&gt;You first assign a value to&amp;nbsp;&lt;SPAN&gt;Saves_Ratio_Score but then before writing the data to the target table you execute always:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;CALL MISSING(Saves_Ratio_Score);&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;This sets the variable always to missing. Just remove this statement and things should work for you as expected.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Aug 2021 08:44:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Null-values-on-bands/m-p/763458#M241791</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2021-08-24T08:44:57Z</dc:date>
    </item>
    <item>
      <title>Re: Null values on bands</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Null-values-on-bands/m-p/763462#M241795</link>
      <description>Thanks a lot Patrick..your solutions works!</description>
      <pubDate>Tue, 24 Aug 2021 08:55:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Null-values-on-bands/m-p/763462#M241795</guid>
      <dc:creator>Solly7</dc:creator>
      <dc:date>2021-08-24T08:55:07Z</dc:date>
    </item>
  </channel>
</rss>

