<?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: Invalid numeric data in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Invalid-numeric-data/m-p/701916#M79880</link>
    <description>It will export fine with the format applied. Have you tried it and it didn't work?</description>
    <pubDate>Thu, 26 Nov 2020 21:14:54 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2020-11-26T21:14:54Z</dc:date>
    <item>
      <title>Invalid numeric data</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Invalid-numeric-data/m-p/701896#M79874</link>
      <description>&lt;P&gt;Hi, I'm new with SAS UE.&lt;BR /&gt;I don't understand why i'm getting this "NOTE: Invalid numeric data" thus wrong dataset. I think i provide the format proc a correct numeric type&lt;/P&gt;&lt;P&gt;The code:&lt;/P&gt;&lt;DIV class="sasNote"&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc fcmp outlib=work.funcs.ConvFuncs;
	function toWatt(x);
		return(x*735.5);
	endsub;
run;

option cmplib = work.funcs;

proc format;
	picture w
		low-high='00000,00 Watt' (decsep=',');
run;

data cars(keep = make origin type horsepower);
	set sashelp.cars;
run;

proc sort data=cars out=sortcars;
	by make;
run;

data max_power_by_types_cars (keep = make suv sedan wagon truck hybrid sports a);
	array max_power {6} _temporary_;
	array types {6} suv sedan wagon truck hybrid sports;
	set sortcars(keep = make type horsepower);
	by make;
	if first.make then do i = 1 to 6; max_power{i}=0; types{i}=0; end;
	select(type);
		when('SUV') i=1;
		when('Sedan') i=2;
		when('Wagon') i=3;
		when('Truck') i=4;
		when('Hybrid') i=5;
		when('Sports') i=6;
		otherwise i=0;
	end;
	if(i&amp;gt;0) then do; 
		if (max_power{i} &amp;lt; horsepower) then max_power{i} = horsepower; *put max_power{i}=  horsepower= make= type=;
	end;
	if last.make then do;
		do i = 1 to 6; if (max_power{i} &amp;gt; 0) then types{i}=put(toWatt(max_power{i}), w.); end;
		output;
	end;
	else return;
run;&lt;/CODE&gt;&lt;/PRE&gt;Piece of LOGS:&lt;/DIV&gt;&lt;BLOCKQUOTE&gt;&lt;DIV class="sasNote"&gt;&lt;DIV class="sasSource"&gt;125 data max_power_by_types_cars (keep = make suv sedan wagon truck hybrid sports);&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;126 array max_power {6} _temporary_;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;127 array types {6} suv sedan wagon truck hybrid sports;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;128 set sortcars(keep = make type horsepower);&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;129 by make;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;130 if first.make then do i = 1 to 6; max_power{i}=0; types{i}=0; end;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;131 select(type);&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;132 when('SUV') i=1;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;133 when('Sedan') i=2;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;134 when('Wagon') i=3;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;135 when('Truck') i=4;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;136 when('Hybrid') i=5;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;137 when('Sports') i=6;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;138 otherwise i=0;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;139 end;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;140 if(i&amp;gt;0) then do;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;141 if (max_power{i} &amp;lt; horsepower) then max_power{i} = horsepower; *put max_power{i}= horsepower= make= type=;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;142 end;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;143 if last.make then do;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;144 do i = 1 to 6; if (max_power{i} &amp;gt; 0) then types{i}=put(toWatt(max_power{i}), w.); end;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;145 output;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;146 end;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;147 else return;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;148 run;&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: Character values have been converted to numeric values at the places given by: (Line):(Column).&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;144:45&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: Invalid numeric data, '94907,50 Watt' , at line 144 column 54.&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: Invalid numeric data, '98585,00 Watt' , at line 144 column 54.&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: Invalid numeric data, '13295,00 Watt' , at line 144 column 54.&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;suv=. sedan=. wagon=. truck=. hybrid=. sports=. Make=Acura Type=Sports Horsepower=290 FIRST.Make=0 LAST.Make=1 i=7 _ERROR_=1 _N_=7&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: Invalid numeric data, '50070,00 Watt' , at line 144 column 54.&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: Invalid numeric data, '50070,00 Watt' , at line 144 column 54.&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: Invalid numeric data, '30975,00 Watt' , at line 144 column 54.&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;suv=. sedan=. wagon=. truck=. hybrid=. sports=. Make=Audi Type=Wagon Horsepower=340 FIRST.Make=0 LAST.Make=1 i=7 _ERROR_=1 _N_=26&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: Invalid numeric data, '39037,50 Watt' , at line 144 column 54.&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: Invalid numeric data, '39037,50 Watt' , at line 144 column 54.&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: Invalid numeric data, '35332,00 Watt' , at line 144 column 54.&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: Invalid numeric data, '44921,50 Watt' , at line 144 column 54.&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;suv=. sedan=. wagon=. truck=. hybrid=. sports=. Make=BMW Type=Wagon Horsepower=184 FIRST.Make=0 LAST.Make=1 i=7 _ERROR_=1 _N_=46&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: Invalid numeric data, ' 2262,50 Watt' , at line 144 column 54.&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: Invalid numeric data, '76520,00 Watt' , at line 144 column 54.&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;suv=. sedan=. wagon=. truck=. hybrid=. sports=. Make=Buick Type=Sedan Horsepower=240 FIRST.Make=0 LAST.Make=1 i=7 _ERROR_=1 _N_=55&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: Invalid numeric data, '35360,00 Watt' , at line 144 column 54.&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: Invalid numeric data, '20650,00 Watt' , at line 144 column 54.&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: Invalid numeric data, '53747,50 Watt' , at line 144 column 54.&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: Invalid numeric data, '35360,00 Watt' , at line 144 column 54.&lt;/DIV&gt;&lt;/DIV&gt;&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Thu, 26 Nov 2020 20:49:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Invalid-numeric-data/m-p/701896#M79874</guid>
      <dc:creator>xxBingoBongoxx</dc:creator>
      <dc:date>2020-11-26T20:49:26Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid numeric data</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Invalid-numeric-data/m-p/701900#M79875</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/358698"&gt;@xxBingoBongoxx&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi, I'm new with SAS UE.&lt;BR /&gt;I don't understand why i'm getting this "NOTE: Invalid numeric data" thus wrong dataset. I think i provide the format proc a correct numeric type&lt;/P&gt;
&lt;P&gt;The code:&lt;/P&gt;
&lt;DIV class="sasNote"&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc fcmp outlib=work.funcs.ConvFuncs;
	function toWatt(x);
		return(x*735.5);
	endsub;
run;

option cmplib = work.funcs;

proc format;
	picture w
		low-high='00000,00 Watt' (decsep=',');
run;

data cars(keep = make origin type horsepower);
	set sashelp.cars;
run;

proc sort data=cars out=sortcars;
	by make;
run;

data max_power_by_types_cars (keep = make suv sedan wagon truck hybrid sports a);
	array max_power {6} _temporary_;
	array types {6} suv sedan wagon truck hybrid sports;
	set sortcars(keep = make type horsepower);
	by make;
	if first.make then do i = 1 to 6; max_power{i}=0; types{i}=0; end;
	select(type);
		when('SUV') i=1;
		when('Sedan') i=2;
		when('Wagon') i=3;
		when('Truck') i=4;
		when('Hybrid') i=5;
		when('Sports') i=6;
		otherwise i=0;
	end;
	if(i&amp;gt;0) then do; 
		if (max_power{i} &amp;lt; horsepower) then max_power{i} = horsepower; *put max_power{i}=  horsepower= make= type=;
	end;
	if last.make then do;
		do i = 1 to 6; if (max_power{i} &amp;gt; 0) then types{i}=put(toWatt(max_power{i}), w.); end;
		output;
	end;
	else return;
run;&lt;/CODE&gt;&lt;/PRE&gt;
Piece of LOGS:&lt;/DIV&gt;
&lt;BLOCKQUOTE&gt;
&lt;DIV class="sasNote"&gt;
&lt;DIV class="sasSource"&gt;125 data max_power_by_types_cars (keep = make suv sedan wagon truck hybrid sports);&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;126 array max_power {6} _temporary_;&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;127 array types {6} suv sedan wagon truck hybrid sports;&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;128 set sortcars(keep = make type horsepower);&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;129 by make;&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;130 if first.make then do i = 1 to 6; max_power{i}=0; types{i}=0; end;&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;131 select(type);&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;132 when('SUV') i=1;&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;133 when('Sedan') i=2;&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;134 when('Wagon') i=3;&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;135 when('Truck') i=4;&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;136 when('Hybrid') i=5;&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;137 when('Sports') i=6;&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;138 otherwise i=0;&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;139 end;&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;140 if(i&amp;gt;0) then do;&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;141 if (max_power{i} &amp;lt; horsepower) then max_power{i} = horsepower; *put max_power{i}= horsepower= make= type=;&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;142 end;&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;143 if last.make then do;&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;144 do i = 1 to 6; if (max_power{i} &amp;gt; 0) then types{i}=put(toWatt(max_power{i}), w.); end;&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;145 output;&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;146 end;&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;147 else return;&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;148 run;&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;NOTE: Character values have been converted to numeric values at the places given by: (Line):(Column).&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;144:45&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;NOTE: Invalid numeric data, '94907,50 Watt' , at line 144 column 54.&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;NOTE: Invalid numeric data, '98585,00 Watt' , at line 144 column 54.&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;NOTE: Invalid numeric data, '13295,00 Watt' , at line 144 column 54.&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;suv=. sedan=. wagon=. truck=. hybrid=. sports=. Make=Acura Type=Sports Horsepower=290 FIRST.Make=0 LAST.Make=1 i=7 _ERROR_=1 _N_=7&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;NOTE: Invalid numeric data, '50070,00 Watt' , at line 144 column 54.&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;NOTE: Invalid numeric data, '50070,00 Watt' , at line 144 column 54.&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;NOTE: Invalid numeric data, '30975,00 Watt' , at line 144 column 54.&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;suv=. sedan=. wagon=. truck=. hybrid=. sports=. Make=Audi Type=Wagon Horsepower=340 FIRST.Make=0 LAST.Make=1 i=7 _ERROR_=1 _N_=26&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;NOTE: Invalid numeric data, '39037,50 Watt' , at line 144 column 54.&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;NOTE: Invalid numeric data, '39037,50 Watt' , at line 144 column 54.&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;NOTE: Invalid numeric data, '35332,00 Watt' , at line 144 column 54.&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;NOTE: Invalid numeric data, '44921,50 Watt' , at line 144 column 54.&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;suv=. sedan=. wagon=. truck=. hybrid=. sports=. Make=BMW Type=Wagon Horsepower=184 FIRST.Make=0 LAST.Make=1 i=7 _ERROR_=1 _N_=46&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;NOTE: Invalid numeric data, ' 2262,50 Watt' , at line 144 column 54.&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;NOTE: Invalid numeric data, '76520,00 Watt' , at line 144 column 54.&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;suv=. sedan=. wagon=. truck=. hybrid=. sports=. Make=Buick Type=Sedan Horsepower=240 FIRST.Make=0 LAST.Make=1 i=7 _ERROR_=1 _N_=55&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;NOTE: Invalid numeric data, '35360,00 Watt' , at line 144 column 54.&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;NOTE: Invalid numeric data, '20650,00 Watt' , at line 144 column 54.&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;NOTE: Invalid numeric data, '53747,50 Watt' , at line 144 column 54.&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;NOTE: Invalid numeric data, '35360,00 Watt' , at line 144 column 54.&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/BLOCKQUOTE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;The array Types contains numeric values as you recognize withe the assignment block in the Select/end.&lt;/P&gt;
&lt;P&gt;On line 144 you are using :&lt;/P&gt;
&lt;PRE&gt; types{i}=put(toWatt(max_power{i}), w.);&lt;/PRE&gt;
&lt;P&gt;The PUT function creates a character value. So attempting to assign something like '20650,00 Watt' to a numeric value is incorrect.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Nov 2020 20:53:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Invalid-numeric-data/m-p/701900#M79875</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-11-26T20:53:02Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid numeric data</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Invalid-numeric-data/m-p/701906#M79877</link>
      <description>&lt;P&gt;Do not use a PUT() statement to convert your data at all. Leave it numeric and the format controls the appearance of the variable. If you want to store it with the decimal and Watt as a variable, it will have to be a character variable. If you have a character variable it's a pain in the a** to sort in any reasonable fashion though or group.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Nov 2020 21:05:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Invalid-numeric-data/m-p/701906#M79877</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-11-26T21:05:24Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid numeric data</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Invalid-numeric-data/m-p/701911#M79878</link>
      <description>So how do i make types array of type string in this case to make it work ?</description>
      <pubDate>Thu, 26 Nov 2020 21:08:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Invalid-numeric-data/m-p/701911#M79878</guid>
      <dc:creator>xxBingoBongoxx</dc:creator>
      <dc:date>2020-11-26T21:08:37Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid numeric data</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Invalid-numeric-data/m-p/701913#M79879</link>
      <description>the thing is i don't care how to store it, i just need to make an output txt from this in the end</description>
      <pubDate>Thu, 26 Nov 2020 21:10:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Invalid-numeric-data/m-p/701913#M79879</guid>
      <dc:creator>xxBingoBongoxx</dc:creator>
      <dc:date>2020-11-26T21:10:37Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid numeric data</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Invalid-numeric-data/m-p/701916#M79880</link>
      <description>It will export fine with the format applied. Have you tried it and it didn't work?</description>
      <pubDate>Thu, 26 Nov 2020 21:14:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Invalid-numeric-data/m-p/701916#M79880</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-11-26T21:14:54Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid numeric data</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Invalid-numeric-data/m-p/701917#M79881</link>
      <description>&lt;P&gt;I mean you can always do the extra work if you want to but it's like putting a wrapped gift in a gift bag.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Nov 2020 21:15:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Invalid-numeric-data/m-p/701917#M79881</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-11-26T21:15:35Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid numeric data</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Invalid-numeric-data/m-p/701920#M79882</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/358698"&gt;@xxBingoBongoxx&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;So how do i make types array of type string in this case to make it work ?&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Do not make the max_power array temporary. Use those values in reports with the format applied.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or make a third array to store the results in using the Put.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think that you may want to check on your formatted values with some known horsepower and expected results. A quick search shows the typical horsepower to watt conversion is 1HP= 745.7watts.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Nov 2020 21:34:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Invalid-numeric-data/m-p/701920#M79882</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-11-26T21:34:09Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid numeric data</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Invalid-numeric-data/m-p/701927#M79883</link>
      <description>&lt;P&gt;The program seems way too complicated.&amp;nbsp; Why not just use PROC SUMMARY to find the MAX?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let factor=735.5 ;

proc format ;
 value $types
    'SUV'   ='1 SUV'
    'Sedan' ='2 Sedan'
    'Wagon' ='3 Wagon'
    'Truck' ='4 Truck'
    'Hybrid'='5 Hybrid'
    'Sports'='6 Sports'
    other   ='0 Other'
 ;
run;

proc summary data=sashelp.cars nway ;
  class make type ;
  var horsepower ;
  format type $types. ;
  output out=max_power_by_types_cars max=maxpower ;
run;

data max_power_by_types_cars;
  set max_power_by_types_cars;
  watts=maxpower*&amp;amp;factor ;
run;

proc report data=max_power_by_types_cars ;
  column make type,(maxpower watts);
  define make / group;
  define type / across format=$types. ;
  format watts comma9.1 ;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/52031i16F51A3C1EB5927A/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Nov 2020 22:03:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Invalid-numeric-data/m-p/701927#M79883</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-11-26T22:03:33Z</dc:date>
    </item>
  </channel>
</rss>

