- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi....I am trying to create a report in pdf and proc report to generated the data and table for the output. I have attached a word document on how I would like each page to look like and having difficulty in inserting the title, footnote and repeated header on top of each page. Any suggestions and help would be greatly appreciated.....Thanks
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Your title requirements can be achieved with SAS title statements. They are not tied to PROC REPORT. Here's the first page of the output produced by the code below.
Cynthia
options nodate nonumber;
ods pdf file='c:\temp\spec_header_titles.pdf';
title bold h=14pt 'The First Title';
title2 j=l 'Client Name' j=r "&sysdate";
title3 j=l 'More Stuff' j=r "Something";
proc print data=sashelp.class;
run;
proc report data=sashelp.class nowd;
run;
proc tabulate data=sashelp.class;
class age;
var height weight;
table age all,
(height*n mean) weight*(min max);
run;
ods pdf close;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Simplest way is to use a by group:
proc report data = xyz...;
title 4 "Client Name: #byval1 Report Date From: #byval2";
by client_name...;
...
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
May I say that your dates in the example look a little odd? 201500430
I get that 2015 would be a year but are you using 3 digits for a month?
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi Ballardw....thank you for pointing that out....it was error....it should of been 20150430 as I was just creating a template of what I would like the output file to look like.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Your title requirements can be achieved with SAS title statements. They are not tied to PROC REPORT. Here's the first page of the output produced by the code below.
Cynthia
options nodate nonumber;
ods pdf file='c:\temp\spec_header_titles.pdf';
title bold h=14pt 'The First Title';
title2 j=l 'Client Name' j=r "&sysdate";
title3 j=l 'More Stuff' j=r "Something";
proc print data=sashelp.class;
run;
proc report data=sashelp.class nowd;
run;
proc tabulate data=sashelp.class;
class age;
var height weight;
table age all,
(height*n mean) weight*(min max);
run;
ods pdf close;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi Cynthia......Thank you so much. I tried something similar to your example but am still having problems with including a macro variable (for example, &rundate that I had defined) with either the title or footnote statements. I don't believe I enclosed the macro variable in double quotes but will try that and see if that resolves the problem. One other think, is it possible to insert a line after title3 and above the first footnote.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Try style:
ods pdf file='c:\temp\x.pdf' style=journal;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi Xia Keshan....I am using style=journal. I would like to insert a line across the page that would separate the Titles from the Table. I am wondering would I have to use the BORDERBOTTOM?
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
NO. Try this one:
ods pdf file='c:\temp\x.pdf' style=journal; title 'xxxxxxxx'; proc report data=sashelp.class nowd style(header)={borderbottomcolor=white}; columns name age; define name/style(column)={bordertopcolor=white}; define age/style(column)={bordertopcolor=white}; run; ods pdf close;
Xia Keshan
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi:
This output was created with the changed code below (using the TITLE statement).
Cynthia
%let rstr = %str( );
%let tstr = %sysfunc(repeat(&rstr,50));
ods escapechar='^';
ods pdf file='c:\temp\spec_header_titlesx.pdf';
title bold h=14pt '1 The First Title';
title2 j=l 'Client Name' j=r "&sysdate";
title3 j=l 'More Stuff' j=r "Something";
title4 "^{style[bordertopwidth=2px bordertopcolor=black] &tstr}";
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Cyntia...Works perfectly!!!