If Overall_Rating is numeric then you have your answer since '1' and '2' are character literals?
proc sql;
select * from sashelp.class
where age in ('14', '15')
;
quit;
Log:
28 proc sql;
29 select * from sashelp.class
30 where age in ('14', '15')
31 ;
ERROR: Expression using IN has components that are of different data types.
NOTE: The IN referred to may have been transformed from an OR to an IN at some point during PROC SQL WHERE clause optimization.
NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of statements.
32 quit;
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE SQL used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds
If Overall_Rating is numeric then you have your answer since '1' and '2' are character literals?
proc sql;
select * from sashelp.class
where age in ('14', '15')
;
quit;
Log:
28 proc sql;
29 select * from sashelp.class
30 where age in ('14', '15')
31 ;
ERROR: Expression using IN has components that are of different data types.
NOTE: The IN referred to may have been transformed from an OR to an IN at some point during PROC SQL WHERE clause optimization.
NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of statements.
32 quit;
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE SQL used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds
Show us the ENTIRE log for this PROC SQL. Showing us an error detached from the code doesn't usually help.
@PaigeMiller wrote:
Show us the ENTIRE log for this PROC SQL. Showing us an error detached from the code doesn't usually help.
Any bets that this new data was created with Proc Import and the result is one or more of the variables changing type.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.