07-14-2015 02:50 PM
I have a doubt.
Is there any way to recover numeric values like:
2.45 is formatted as comma10.2, but it's damaged, because this value comes like this 2.446,58 as string.
So the value of 2.45 is after i format the variable, but i need then like 2.446,58.
Is there any way to recover it ?
07-14-2015 03:43 PM
How did you try to convert the string to a number?
You can use the COMMA informat to read numbers in the normal format for your LOCALE setting.
Use COMMAX informat to read those where the roles of the comma and the period have been reversed.
38 data sample;
39 input str $20. ;
40 num1 = input(str,comma20.);
41 num2 = input(str,commaX20.);
42 put (_all_) (=);
str=1,234.56 num1=1234.56 num2=1.23456
str=1.234,56 num1=1.23456 num2=1234.56
07-14-2015 03:46 PM
Do you already have the values as numbers and no longer have the strings?
Print the number without a format (or using the BEST format).
You might just need to multiple by 1000 for that example.
But if the original number was less than 100 and it had 2 decimal places you would need to divide by 100.
If the original value was greater than a million then you probably have a missing numeric value.