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.
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!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.