I have a field called customer_id which has field type=character but It has 90,000 numbers and about 100 names.
When I convert the field type from character to numeric, it stumbles on the 100 names since they cannot be converted to numeric. I do not care about these names and want to remove them so only numbers will be retained.
Code
-------
data temp (keep = customer_skey customer_id) ;
set fdw.customer;
customer_id_new=input(customer_id, 8.);
run;
Error message :
------------------
Mathematical operations could not be performed at the following places. The results of the operations have been set to missing values.
The problem is that it does NOT create the new field which is numeric, it just gives up. I would like the program to ignore these errors where the data are characters
OR
I would like to remove the character data so the remaining numbers can easily converted to numeric data types.
Is there a way to purge out all character data from a field and keep only numeric, so the datatype can be converted from character to numeric?