07-13-2015 03:58 PM
Hi, i'm trying to convert a string variable to numeric.
It's values are as follows:
But when i convert to numeric with the code below:
FORMAT VALOR_NEW COMMAX8.2;
There are only missing values.
I've tried to use all other number formats but it does not work.
07-13-2015 04:47 PM
Depends on the result you would want. If you want the commas to be ignored, use:
valor_new = input(valor, comma8.);
If you want two positions after the decimal point every time, use:
valor_new = input(valor, comma8.2);
07-13-2015 05:16 PM
Use COMMAX. on input, that's where the comma must be taken care of :
input str $;
x = input(str, commax32.);
format x best.;