11-26-2020
xxBingoBongoxx
Calcite | Level 5
Member since
11-26-2020
- 3 Posts
- 1 Likes Given
- 0 Solutions
- 0 Likes Received
-
Latest posts by xxBingoBongoxx
Subject Views Posted 3526 11-26-2020 04:10 PM 3532 11-26-2020 04:08 PM 3573 11-26-2020 03:45 PM -
Activity Feed for xxBingoBongoxx
- Liked Re: Invalid numeric data for Reeza. 11-26-2020 04:18 PM
- Posted Re: Invalid numeric data on SAS Procedures. 11-26-2020 04:10 PM
- Posted Re: Invalid numeric data on SAS Procedures. 11-26-2020 04:08 PM
- Posted Invalid numeric data on SAS Procedures. 11-26-2020 03:45 PM
-
Posts I Liked
Subject Likes Author Latest Post 1
11-26-2020
04:10 PM
the thing is i don't care how to store it, i just need to make an output txt from this in the end
... View more
11-26-2020
04:08 PM
So how do i make types array of type string in this case to make it work ?
... View more
11-26-2020
03:45 PM
Hi, I'm new with SAS UE. 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 The code: 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>0) then do;
if (max_power{i} < 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} > 0) then types{i}=put(toWatt(max_power{i}), w.); end;
output;
end;
else return;
run; Piece of LOGS: 125 data max_power_by_types_cars (keep = make suv sedan wagon truck hybrid sports); 126 array max_power {6} _temporary_; 127 array types {6} suv sedan wagon truck hybrid sports; 128 set sortcars(keep = make type horsepower); 129 by make; 130 if first.make then do i = 1 to 6; max_power{i}=0; types{i}=0; end; 131 select(type); 132 when('SUV') i=1; 133 when('Sedan') i=2; 134 when('Wagon') i=3; 135 when('Truck') i=4; 136 when('Hybrid') i=5; 137 when('Sports') i=6; 138 otherwise i=0; 139 end; 140 if(i>0) then do; 141 if (max_power{i} < horsepower) then max_power{i} = horsepower; *put max_power{i}= horsepower= make= type=; 142 end; 143 if last.make then do; 144 do i = 1 to 6; if (max_power{i} > 0) then types{i}=put(toWatt(max_power{i}), w.); end; 145 output; 146 end; 147 else return; 148 run; NOTE: Character values have been converted to numeric values at the places given by: (Line):(Column). 144:45 NOTE: Invalid numeric data, '94907,50 Watt' , at line 144 column 54. NOTE: Invalid numeric data, '98585,00 Watt' , at line 144 column 54. NOTE: Invalid numeric data, '13295,00 Watt' , at line 144 column 54. suv=. sedan=. wagon=. truck=. hybrid=. sports=. Make=Acura Type=Sports Horsepower=290 FIRST.Make=0 LAST.Make=1 i=7 _ERROR_=1 _N_=7 NOTE: Invalid numeric data, '50070,00 Watt' , at line 144 column 54. NOTE: Invalid numeric data, '50070,00 Watt' , at line 144 column 54. NOTE: Invalid numeric data, '30975,00 Watt' , at line 144 column 54. suv=. sedan=. wagon=. truck=. hybrid=. sports=. Make=Audi Type=Wagon Horsepower=340 FIRST.Make=0 LAST.Make=1 i=7 _ERROR_=1 _N_=26 NOTE: Invalid numeric data, '39037,50 Watt' , at line 144 column 54. NOTE: Invalid numeric data, '39037,50 Watt' , at line 144 column 54. NOTE: Invalid numeric data, '35332,00 Watt' , at line 144 column 54. NOTE: Invalid numeric data, '44921,50 Watt' , at line 144 column 54. suv=. sedan=. wagon=. truck=. hybrid=. sports=. Make=BMW Type=Wagon Horsepower=184 FIRST.Make=0 LAST.Make=1 i=7 _ERROR_=1 _N_=46 NOTE: Invalid numeric data, ' 2262,50 Watt' , at line 144 column 54. NOTE: Invalid numeric data, '76520,00 Watt' , at line 144 column 54. suv=. sedan=. wagon=. truck=. hybrid=. sports=. Make=Buick Type=Sedan Horsepower=240 FIRST.Make=0 LAST.Make=1 i=7 _ERROR_=1 _N_=55 NOTE: Invalid numeric data, '35360,00 Watt' , at line 144 column 54. NOTE: Invalid numeric data, '20650,00 Watt' , at line 144 column 54. NOTE: Invalid numeric data, '53747,50 Watt' , at line 144 column 54. NOTE: Invalid numeric data, '35360,00 Watt' , at line 144 column 54.
... View more