mercredi 18 juillet 2018

Setting a variable equal to 0 or 1 using an IF statement in SAS

I've been searching the documentation and experimenting myself but I can't figure out whether or not you can set a variable using an IF statement. For instance

x = if y >= 1; 

would set x equal to 1 if y is greater than or equal to 1 and 0 otherwise. Is this possible in SAS? Do you have to do

if y >= 1 then x = 1; else x = 0;

Aucun commentaire:

Enregistrer un commentaire