Please can someone tell me how I can exclude the missing row from my proc sql table? The code that I have got is as follows, so the output should only show the names (and no blank row in the output).
proc sql;
create table Records as
select distinct Name
from Test
where "01May2021"d<=MONTH<="31May2021"d
except
select distinct Name
from Test
where "01Apr2021"d<=MONTH<="30Apr2021"d
;
quit;
proc sql;
create table Records as
select distinct Name
from Test
where "01May2021"d<=MONTH<="31May2021"d and not missing(name)
except
select distinct Name
from Test
where "01Apr2021"d<=MONTH<="30Apr2021"d
;
quit;
You need to explain what you mean by "blank" or "missing" row. What defines such a row?
My output, 'Records' (see code above) gives the following, so it's row 1 in my example that I would like to exclude (i.e. I only want the distinct Name values to be in the output).
proc sql;
create table Records as
select distinct Name
from Test
where "01May2021"d<=MONTH<="31May2021"d and not missing(name)
except
select distinct Name
from Test
where "01Apr2021"d<=MONTH<="30Apr2021"d
;
quit;
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 save with the early bird rate—just $795!
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.