The SAS Output Delivery System and reporting techniques

Suppress Variable Headers in Proc Print

Reply
Contributor
Posts: 66

Suppress Variable Headers in Proc Print

Hello,
I want to use a proc print statement as a drill down from an ODS report I am building for work. I want it to act like a master-detail set where selecting a hyper linked row in the first table takes the user to a detail page. Proc print by default presents the data as

var1 | var2
one: a
two: b

I want to present the page without the headers so I would look like this

one: a
two: b

Is there an easy option to suppress the header row? Thanks in advance
SAS Super FREQ
Posts: 8,743

Re: Suppress Variable Headers in Proc Print

Hi:
There are 2 ways to do what you want ...
1) fool PROC PRINT by using the split character as the column header
2) use PROC REPORT with the NOHEADER option

If all you are doing is writing output to the LISTING window, then either method will work. If you want ODS output (RTF, PDF or HTML), then the PROC REPORT method is better.

cynthia

[pre]
ods listing;

ods html file='c:\temp\stuff.html';
ods pdf file='c:\temp\stuff.pdf';
ods rtf file='c:\temp\stuff.rtf';

proc report data=sashelp.class nowd noheader;
title 'proc report w/noheader option';
column name age height;
run;

proc print data=sashelp.class noobs split='*';
title 'proc print';
var name height;
label height = '*'
name = '*';
run;

ods _all_ close;
[/pre]
Contributor
Posts: 66

Re: Suppress Variable Headers in Proc Print

Thanks for the reply both of you.

My first preference was to use data _null_ but I have found it to return no output (because of our setup configuration).

Thanks for the snippet. I had forgotten about noheader.
N/A
Posts: 0

Re: Suppress Variable Headers in Proc Print

rather than use proc print, use a simple data step, like:[pre]data _null_ ;
file 'your.destination file.CSV' dsd lrecl= 1000 ;
set your.data ;
where ;
put ......... see below ;
run;[/pre] That put statement has 2 alternatives. If you want all columns in column order, then use[pre] put (_all_)(Smiley Happy ;[/pre] For an explicit list like a VAR statement for proc print, use, for example: [pre] put ( var1 var2 )(Smiley Happy ;[/pre]

Good Luck

PeterC
SAS Super FREQ
Posts: 8,743

Re: Suppress Variable Headers in Proc Print

Hi:
The DATA step would work if you were creating a flat file, such as a CSV file or an ASCII text file. But if you're using FILE PRINT ODS and creating a report, then DATA _NULL_ with FILE PRINT ODS would still give you headers unless you changed the table template for use with Data step.
cynthia
Ask a Question
Discussion stats
  • 4 replies
  • 2768 views
  • 0 likes
  • 3 in conversation