04-12-2018 07:53 AM
I got this error when I wanted to set tow datasets together ( ERROR: VARIABLE CALVING_EASE HAS BEEN DEFINED AS BOTH CHARACTER AND NUMERIC )
DATA ALL; SET DATA9 DATA10; RUN;
the variable calving_ease was having NA DATA I hade changed to missing data by using this second code and I still having the same issue
data want; set mfd4; if anyalpha(calving_ease) then call missing(calving_ease); run;
What can I do for this situation?
04-12-2018 07:59 AM
call missing does not change the type of a variable, it just either sets to a numeric missing or blanks for character variables.
You need to do a conversion in one of your datasets.
Still better is to look where the variable is created in the first place, and make the correction there.
04-12-2018 08:10 AM
I gave you the right approach when you posted the earlier problem here:
The solution you chose did not convert from character to numeric, hence the current problem.
04-16-2018 03:22 AM
data9 and data10 has VARIABLE CALVING_EASE of different types.
One is having character and other is numeric. So when you try to concatenated them using 'set' statement, it throws error that the data type is different.
You need to change the datatype of the said variable in one of the dataset so that it is in line with the other one.