Hi! I am struggling with SAS syntax error diagnosis. I am new to SAS and I have been trying hard to resolve simple errors but I still cant. Any help with the below error from my proc procedure please.
proc sql;
create table Co_STLoc as
select a.*, b.St_fips AS Client_state, co_fips AS G132
from Co_ST_Out as a left join Fipsmod1 as b
on a.State = b.State AND a.county = b.county;
quit;
ERROR: Expression using equals (=) has components that are of different data types.
In a.state=b.state, one data set has state as numeric and the other has state as character. Or, it applies to a.county = b.county.
So you have to have two character variables, or two numeric variables, surrounding the equal sign, for this to work.
Nearly 200 sessions are now available on demand in the Innovate Hub.
Watch Now →SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.
Find more tutorials on the SAS Users YouTube channel.