I want to delete the rows that have empty columns for a certain range of columns (q7_16 - q7_505). The columns are not in numeric order. I don't want to write out each column because I have to do this with a much larger dataset next.
So, if columns q7_16, q7_17, q7_18, q7_19, q7_2, q7_2094, q7_504, and q7_505 are blank, then delete those rows.
Picture is attached to show the dataset.
I tried:
data severity_lrd_7_v3b;
set severity_lrd_7;
where survey_desc = "V3B";
if n(of q7_16-q7_505);
run;but then it adds every number from 16-505 which I do not want.
Provided that your variables of interest are side by side, you can do this
data severity_lrd_7_v3b;
set severity_lrd_7;
where survey_desc = "V3B";
if n(of q7_16--q7_505);
run;
Provided that your variables of interest are side by side, you can do this
data severity_lrd_7_v3b;
set severity_lrd_7;
where survey_desc = "V3B";
if n(of q7_16--q7_505);
run;
Sure thing 🙂 Anytime.
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.