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
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;
Simplest way is to use a by group:
proc report data = xyz...;
title 4 "Client Name: #byval1 Report Date From: #byval2";
by client_name...;
...
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?
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.
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;
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.
Try style:
ods pdf file='c:\temp\x.pdf' style=journal;
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?
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
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}";
Thanks Cyntia...Works perfectly!!!
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.