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.
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
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.
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.
Ready to level-up your skills? Choose your own adventure.