The SAS Output Delivery System and reporting techniques

Automatic generation of table titles in long PDF reports

Reply
Occasional Learner
Posts: 1

Automatic generation of table titles in long PDF reports

[ Edited ]

Dear Community,

 

I'm looking for a way to automatically generate table headers throughout long pdf reports.

 

Now, I'm writing the titles manually, which is time-consuming and error-prone (SAS V9.3 on Windows 8.1, ODS PDF and/or ODS RTF):

 

ods proclabel 'Table 1 - Patient Disposition - Full Analysis Set';
title5 j=C  f=Courier h=9pt 'Table 1';
title6 j=C f=Courier h=9pt 'Patient Disposition - Full Analysis Set';
title7 j=C f=Courier h=9pt 'Population:  Full Analysis Set';
footnote1 j=l  f=Courier h=9pt "DS_T_01.sas     &date" j=r '    Page ^{thispage} of ^{lastpage}';
proc report data = tlf.dS_t_01  nowd style(report)=[font_size=8pt font=(Courier)]

 

 

Is there a way to automatize the generation of table titles by writing a dataset that contains the header information linked to the reported data (eg. tlf.dS_t_01 || Table 1 || Patient Disposition || Full Analysis Set)? Or do you have any other suggestions?

 

Thanking you in anticipation,

Row

SAS Super FREQ
Posts: 8,646

Re: Automatic generation of table titles in long PDF reports

Hi:
Using Macro variables is one way to automate the insertion of titles and footnotes. It is easy using CALL SYMPUT or CALL SYMPUTX to make macro variables from observations/columns in a SAS dataset.

cynthia
Super User
Super User
Posts: 5,982

Re: Automatic generation of table titles in long PDF reports

What part of it do you want to automate?

A simple first step is to pull out the parts that change as macro variables.

 

%let tableno=1;
%let desc=Patient Disposition;
%let pop=Full Analysis Set;
%let pgm=DS_T_01.sas;
%let dsn=tlf.dS_t_01;

Then the code that generates the titles/ods statements can be boilerplate.

 

 

ods proclabel "Table &tableno - &desc - &pop";
title5 j=C  f=Courier h=9pt "Table &tableno";
title6 j=C f=Courier h=9pt "&desc - &pop";
title7 j=C f=Courier h=9pt "Population:  &pop";
footnote1 j=l  f=Courier h=9pt "&pgm     &date" j=r '    Page ^{thispage} of ^{lastpage}';
proc report data = &dsn  nowd style(report)=[font_size=8pt font=(Courier)]

 

Post a Question
Discussion Stats
  • 2 replies
  • 96 views
  • 0 likes
  • 3 in conversation