Usage Note 24493: Is there a style that mimics the LISTING destination that I can use in HTML, PDF, or RTF destinations?
By design each of the ODS destinations has a different look because each one has a different audience. HTML is meant to be viewed on the Web, and PDF is meant to be viewed or printed from Adobe Acrobat Reader. Therefore, there is not a predefined style that makes the output from the other destinations look like ODS LISTING (the Output window).
The PROC TEMPLATE code in the FULL CODE tab makes a style that attempts to mimic the LISTING output by changing fonts to a monospace font (in this case, Courier) and reducing the cell padding of the tables. Note the change to the grid lines to accommodate the table grids that are used by TABULATE and PROC FREQ's crosstab tables.
The DATA Step code in the FULL CODE tab shows an alternate method to create PDF output which mimics the LISTING destination.
For sample code that is applicable to the RTF destination, see SAS Note 4025.
Operating System and Release Information
*
For software releases that are not yet generally available, the Fixed
Release is the software release in which the problem is planned to be
fixed.
The PROC TEMPLATE code shown for Method 1 makes a style that attempts to mimic the LISTING output by changing fonts to a monospace font (in this case, Courier) and reducing the cell padding of the tables. Note the change to the grid lines to accommodate the table grids that are used by TABULATE and PROC FREQ's crosstab tables.
The DATA Step code shown for Method 2 demonstrates an alternate method to create PDF output which mimics the LISTING destination. Method 2 is dependent upon traditional LISTING syntax like Linesize and Pagesize.
/* Method 1 */
proc template;
define style styles.likelista;
parent=styles.printer;
replace fonts /
'BatchFixedFont' = ("Courier",8pt)
'TitleFont2' = ("Courier",8pt)
'TitleFont' = ("Courier",8pt)
'StrongFont' = ("Courier",8pt)
'EmphasisFont' = ("Courier",8pt)
'FixedEmphasisFont' = ("Courier",8pt)
'FixedStrongFont' = ("Courier",8pt)
'FixedHeadingFont' = ("Courier",8pt)
'FixedFont' = ("Courier",8pt)
'headingEmphasisFont' = ("Courier",8pt)
'headingFont' = ("Courier",8pt)
'docFont' = ("Courier",8pt);
style table from output /
cellpadding = 2pt
cellspacing = 0pt
background=white
rules=none
frame=void;
replace color_list /
'link' = black
'bgH' = white
'fg' = black
'bg' = white;
end;
define style styles.likelistb;
parent=styles.likelista;
style table from output /
cellpadding = 2pt
cellspacing = 0pt
background=white
rules=all
frame=void;
end;
run;
ods noproctitle;
ods pdf file='method1.pdf' style=styles.likelista notoc;
proc print data=sashelp.class;
run;
ods pdf style=styles.likelistb;
proc freq data=sashelp.class(obs=10);
tables age*name;
run;
ods _all_ close;
/*Method 2*/
options ls=120 ps=84 center nodate nonumber orientation=portrait;
ods listing file='c:\temp\tmp.lst';
proc print data=sashelp.class;
title 'Get listing look in PDF';
footnote "Footnote";
run;
proc freq data=sashelp.class(obs=10);
tables age*name;
run;
ods listing close;
title;
footnote;
ods pdf file='method2.pdf' notoc;
data _null_;
infile 'c:\temp\tmp.lst' length=lg;
input @1 line $varying400. lg;
file print ;
put @1 line $varying. lg;
run;
ods pdf close;
ods proctitle;
| Type: | Usage Note |
| Priority: | low |
| Topic: | Third Party ==> Output ==> HTML SAS Reference ==> ODS (Output Delivery System) System Administration ==> Printing Third Party ==> Output ==> PDF
|
| Date Modified: | 2011-06-08 12:22:31 |
| Date Created: | 2006-02-22 14:02:29 |