Data tagline1;
Set tagline;
If var1 = -3 then varnew = .;
run;
When attempting to run this it does not identify -3 as sas missing includes it within the output.
This code will do as you tell it to do. What exactly is not working as you'd expect?
Assuming you create varnew in your data step and it doesn't already exist in table tagline:
You never assign a value to varnew so it will always be missing whether the condition is now true or not.
Please post code by copy/pasting it into a code box. No need to create nigh-unreadable pictures.
A code box is opened with the "little running man" button right next to the one indicated:
The indicated button is for logs.
In your code whenever tagline = -3 is true then tagline <40 will be true as well. And because this is not an IF/ELSE construct the last test wins and tagline_new will be set to 1 for cases where tagline = -3.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.