good day,
I am do some checkings on my data base.
Name
row1
row2
if row1_name =row2_name then checking="Y"
and the result is "Y"
how can i avoid this?
thanks in advance
Regards,
Harry
I am guessing without actual data but if you want some assigned only when the values are not missing then you have to test for that before the assignment. Blank=blank (or missing = missing) is true.
if not missing(row1_name) and not missing(row2_name) and row1_name =row2_name then checking="Y";
Missing is one of the few functions that works with both character or numeric values. A character value of blank would be considered "missing".
For your specific issue possibly only need to check one of the values for missing but it is better practice to be explicit about when you want something done because 6 months later when you come back to modify the code because something else needs to be added you may not remember that you may want to have a separate behavior for when only one is missing...
Could you please provide some sample data with expected output to get better response.
I am guessing without actual data but if you want some assigned only when the values are not missing then you have to test for that before the assignment. Blank=blank (or missing = missing) is true.
if not missing(row1_name) and not missing(row2_name) and row1_name =row2_name then checking="Y";
Missing is one of the few functions that works with both character or numeric values. A character value of blank would be considered "missing".
For your specific issue possibly only need to check one of the values for missing but it is better practice to be explicit about when you want something done because 6 months later when you come back to modify the code because something else needs to be added you may not remember that you may want to have a separate behavior for when only one is missing...
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.