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-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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