BookmarkSubscribeRSS Feed
CameronLawson
Obsidian | Level 7
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
4 REPLIES 4
Cynthia_sas
SAS Super FREQ
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]
CameronLawson
Obsidian | Level 7
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.
deleted_user
Not applicable
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_)(:) ;[/pre] For an explicit list like a VAR statement for proc print, use, for example: [pre] put ( var1 var2 )(:) ;[/pre]

Good Luck

PeterC
Cynthia_sas
SAS Super FREQ
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

sas-innovate-2024.png

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.

 

Register now!

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
  • 14452 views
  • 2 likes
  • 3 in conversation