Data _null_;
set have;
if year=2000 then put name=;
run
If you mean to print the value of the variable NAME to the log when year is 2000.
@Emma2021 wrote:
Sorry, I want to check the name for the year=2000. So, if I find year=2000, then I want to print out in log whatever value has the variable “name”. Thank you
Data _null_;
set have;
if year=2000 then put name=;
run
If you mean to print the value of the variable NAME to the log when year is 2000.
@Emma2021 wrote:
Sorry, I want to check the name for the year=2000. So, if I find year=2000, then I want to print out in log whatever value has the variable “name”. Thank you
proc print data=have(where =(year=2000));
var name;
run;
Why would you use the log for that type of functionality? Wouldn't results or some other output be more useful?
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!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.