08-23-2017 03:57 PM
I get the above error message (Error: Expression using equals (=) has components that are of different data types) upon running the following code:
create table disease_standard as
select year, age_group, sex, disease
where disease=1 and year=.
I'm not sure what the error message means, and how to go about fixing it. Any help?
08-23-2017 04:04 PM
You miss semicolons on all lines executing the macro. It should be:
%eventsum(period=2013); %eventsum(period=2014); %eventsum(period=2015); %eventsum(period=2016); %eventsum(period=2017);
Alternatively, if have semicolons and this is just typo on post,
then probably PERIOD is defined as charcter and you have to code execution like:
%eventsum(period='2013'); %eventsum(period='2014'); %eventsum(period='2015'); %eventsum(period='2016'); %eventsum(period='2017');
08-23-2017 04:24 PM
08-23-2017 04:26 PM
Post your new code and log.
Ideally, a proc contents on your data set as well, unless you're sure you've corrected the type issue already.
08-23-2017 04:07 PM
Check your variable types for the two variables in your WHERE clause. If either are character they require quotes around the values.
where disease='1' and year=&period
where disease=1 and year="&period"
Or possibly both combined.
08-24-2017 09:22 PM
proc sql; describe table dataset_name;
the log will show you the data structure;
use quotes accordingly
as noted by an earlier responder.
Ron Fehd data structure!