BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
michelconn
Quartz | Level 8

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.

 

 

report.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

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;
1 ACCEPTED SOLUTION

Accepted Solutions
Ksharp
Super User
	define sample_org /  across ''  NOZERO ;
	define moisture / across '' format=wetdry.  NOZERO;
	define bead / across ''   NOZERO;

View solution in original post

4 REPLIES 4
SuryaKiran
Meteorite | Level 14

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

Thanks,
Suryakiran
ballardw
Super User

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

Ksharp
Super User
	define sample_org /  across ''  NOZERO ;
	define moisture / across '' format=wetdry.  NOZERO;
	define bead / across ''   NOZERO;
michelconn
Quartz | Level 8
That worked perfect, thanks!

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 4241 views
  • 2 likes
  • 4 in conversation