BookmarkSubscribeRSS Feed
fredbell
Fluorite | Level 6
Anyone know why i am getting this error, level_7_id are both of same data type?



44 PROC SQL;
45 CREATE table Calls_Handled_Temp AS
46 SELECT A.SiteID,A.Indicator_OutSource, B.ReportTime,B.Level_7_ID, B.agentcallshandled
47 FROM level7 A FULL JOIN jennifer.tbl_vccartsceintrvl B
48 ON (A.Level_7_ID = B.Level_7_ID)
49 WHERE
50 ReportTime >= &MTDfromdate and ReportTime <= &MTDTodate
51 order by ReportTime asc;
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.
52
53 QUIT;

Fred
3 REPLIES 3
Paige
Quartz | Level 8
Perhaps you made a typo? There is no "IN" expression shown in your code.
deleted_user
Not applicable
Please check where condition and Macro Variable value and data type.
If you want to check, please run without where condition then see.
If you are not getting any error then it would be problem with the Macro variable .
Peter_C
Rhodochrosite | Level 12
> Anyone know why i am getting this error, level_7_id
> are both of same data type?
>
>
>
> 44 PROC SQL;
> 45 CREATE table Calls_Handled_Temp AS
> 46 SELECT A.SiteID,A.Indicator_OutSource,
> B.ReportTime,B.Level_7_ID, B.agentcallshandled
> 47 FROM level7 A FULL JOIN
> jennifer.tbl_vccartsceintrvl B
> 48 ON (A.Level_7_ID = B.Level_7_ID)
> 49 WHERE
> 50 ReportTime >= &MTDfromdate and ReportTime <=
> &MTDTodate
> 51 order by ReportTime asc;
> 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.
> QUIT;
> red

unfortunately a GE and LE symbol have mis-directed the browser surface

The original message text may now be visible as quoted above, along with the hint

NOTE: The IN referred to may have been transformed from an OR to an IN at some point during PROC SQL where clause optimization.

I would suggest using option SYMBOLGEN and converting the testing of ReportTime into a "between" test like

where reportTime between &MTDfromdate and &MTDtodate

good luck
peterC

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 2993 views
  • 0 likes
  • 4 in conversation