Is there a way to remove blank columns from a proc report? Essentially I want to remove any blank column since that is a combination that does not exist.
proc report nowindows data=mgp_Mean_Merge (where=(Matrix='Soil')) spanrows nowd;
columns timepoint Temperature ( 'Mean (Stdev, Percent Detected)' SBvalue,sample_org,moisture,bead);
define timepoint / group order=internal style(column)=[vjust=m just=l] format=timepoint. 'Timepoint';
define Temperature / group order=internal format=temp. 'Temperature';
define sample_org / across '';
define moisture / across '' format=wetdry.;
define bead / across '';
define SBvalue / group '';
run;
define sample_org / across '' NOZERO ;
define moisture / across '' format=wetdry. NOZERO;
define bead / across '' NOZERO;
If you don't want them in your report then drop those variables (variables with all missing values) before running the proc report.
Check this solution to drop variables with null values; https://communities.sas.com/t5/SAS-Procedures/Dropping-variables-with-null-values/td-p/185892
You might consider moving to proc tabulate as nested column/row combinations by default only have populated ones in the output assuming none of the records are actually missing the group or across variables (class in Tabulate)
Since you don't show what variable is actually analyzed I can't get more specific than that
define sample_org / across '' NOZERO ;
define moisture / across '' format=wetdry. NOZERO;
define bead / across '' NOZERO;
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.