I'm trying to run a proc report on a dataset that can have missing values (valid) in two columns (x & y), both of which are grouped. Is there a way to NOT show missing values from x, but to still show missing values from y in the report? The missing option either shows all of them or takes them all away, which I don't want.
Example:
title BOLD HEIGHT=4 'US';
proc report data=us.rates missing;
columns x y date,(n pctn) ;
define x/ group 'x' width = 5;
define y / group 'y' width = 3;
define dumcol / computed 'x';
define date / across order = internal;
define n / format =8. 'COUNT';
define pctn / "%" format = percent7.1;
rbreak after / summarize;
compute dumcol / char length = 10;
if _BREAK_ = '_RBREAK_' then dumcol = 'Total';
else dumcol = put(x,$10.);
endcomp;
run;
title;
Have you tried removing MISSING from the Proc statement and adding it to DEFINE options for Y (and any other variables that may want missing to appear)?
I would think you would need to code the "missing" values differently. Perhaps a '999' in one data set and a '.' in the other.
That would work for me, but then I would need to exclude 999 from the count, percentage etc. Is there a way to exclude a certain value?
Have you tried removing MISSING from the Proc statement and adding it to DEFINE options for Y (and any other variables that may want missing to appear)?
This worked, thank you!!!
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!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.