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.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
Get started using SAS Studio to write, run and debug your SAS programs.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.