BookmarkSubscribeRSS Feed
Feksan
Fluorite | Level 6

Please I understand the error.

 

SELECT *,
70 CASE WHEN nouveaux_cas>moyenne_globale THEN 1
71 ELSE 0 end as comparaison_moyenne_globale
72 FROM d1.COVID_DATA;
ERROR: Expression using greater than (>) has components that are of different data types.
ERROR: The following columns were not found in the contributing tables: moyenne_globale.

2 REPLIES 2
jimbarbour
Meteorite | Level 14

@Feksan

 

The first message means that one of the data elements appears to be character but the other numeric nouveaux_cas to moyenne_globale.

The second message says that the variable, moyenne_globale, is not in the data.  If moyenne_globale is not in the data, then SAS will assume that moyenne_globale is numeric which could cause the first message.

 

Can you run this code and post the results?

PROC CONTENTS DATA=D1.COVID_DATA;
RUN;

Jim

Kurt_Bremser
Super User

Maxim 3: Know Your Data.

There is no variable moyenne_globale in your dataset.

Run a PROC CONTENTS on d1.COVID_DATA to determine which variables are contained in it.

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

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
  • 2 replies
  • 962 views
  • 1 like
  • 3 in conversation