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;
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.