Help using Base SAS procedures

Ods pdf

Reply
N/A
Posts: 0

Ods pdf

I am creating a pdf report with the first page displays just the logo and few titles and from 2nd page displays compare report . The first page looks fine but 2nd page starts with a very 1st line as "Continuing contents of page 1, which would not fit on a single physical page". Why do I get this line when there is not much content in the 1st page?

Also the entire report has a grey background when printed. How to changes this to either "no color" or white background?
Any help would be appreciated.

Thanks.
SAS Super FREQ
Posts: 8,740

Re: Ods pdf

Hi:
What version of SAS are you using (SAS 9.1.3 or SAS 9.2)?? It would also be useful if you could post the code that you're using -- the ODS PDF code and the procedure code to create the title page and the other pages??? Are you using any "pre-production" features such as ODS LAYOUT?? Do you have any margin settings or orientation settings in an OPTIONS statement??

Usually, the PDF output has a white background when the default PRINTER style is used for ODS PDF. Does your ODS PDF invocation have a STYLE= option, and if so, what is the style that you're using???

Also, for future reference, this is a very handy forum posting that explains how to post questions and still maintain the indenting of code that you want to show:
http://support.sas.com/forums/thread.jspa?messageID=27609毙

cynthia
N/A
Posts: 0

Re: Ods pdf

Hi Cynthia,

Thanks for your reply.
I am using SAS version 9.1.3. Also I use all the options you mentioned.
Here's my code for your reference. I am using Printer styles.

proc template;
define style Styles.Printer / store = SASUSER.TEMPLAT;
parent = styles.default;
replace fonts /
'Body' = ("Arial",10pt)
'PageNo' = ("Arial",6.7pt)
'Systemfooter' = ("Arial",6pt,Italic)
'systemtitle' = ("Arial",2pt,Italic)
'docFont' = ("Arial, Helvetica, sans-serif",1)
'LayoutContainer' = ("Arial",6pt)
'headingFont' = ("Arial",10pt,Bold Italic)
'headingEmphasisFont' = ("Times New Roman",10pt,Bold Italic)
'FixedFont' = ("Arial",10pt)
'BatchFixedFont' = ("SAS Monospace,Courier",9pt)
'FixedHeadingFont' = ("Arial",9pt,Bold)
'FixedStrongFont' = ("Arial",9pt,Bold)
'FixedEmphasisFont' = ("Arial",9pt,Italic)
'EmphasisFont' = ("Arial",8pt,Italic)
'StrongFont' = ("Arial",8pt)
'TitleFont' = ("Arial",8pt,Italic)
'TitleFont2' = ("Arial",8pt,Italic);
end;
run;
data work.title;
drop i;
length line $80;
do i = 1 to 1 by 1;
line = ' ';
output;
end;
line = '~S={just=center font_face=arial font_size=14pt}'
||'Protocol CP-05-233 ~S={}';
output;
line= '~S={just=center font_face=arial font_size=14pt}'
||'SAS Transfer Report ~S={}';
output;
run;

ods listing close;
ods pdf;
options nodate pageno=1;
ods pdf file='P:\SASTransferReport.pdf';
ods layout start;
ods escapechar='~';
Options FORMCHAR="|----|+|---+=|-/\<>*";
proc report data=work.title noheader center nowd
style(report)={background=white preimage='P:\\SAS Transfer Report\logo.jpg'};
column line;
define line /display center
style(column)={just=center font_weight=bold font_face=Arial foreground=dark blue background=white};
title1 j=r h=8pt font=arial "%sysfunc(today(),weekdate.)";
title2 ' ';
footnote1 j=c "Confidential";
run;
ods layout end;

%macro strtbl(tbl=);
title1 j=r h=8pt font=arial "%sysfunc(today(),weekdate.)";
title2 ' ';
footnote1 j=c "Confidential";
ods pdf startpage=no;
ods trace on;
proc contents data=trdata.&tbl order=varnum noprint;
run;
ods trace off;

ods select position;
proc contents data=trdata.&tbl order=varnum;
run;

ods pdf startpage=no;
proc compare base=refdata.&tbl compare=trdata.&tbl novalues noprint;
run;

ods select Comparedatasets;
proc compare base=refdata.&tbl compare=trdata.&tbl;
run;
%mend strtbl;

%strtbl(tbl=AE);
SAS Super FREQ
Posts: 8,740

Re: Ods pdf

Hi:
(Hit Post instead of Preview on previous posting...sorry 'bout that)

One issue with your code is that you have parent=styles.default, which by default has a gray background. If you inherited from STYLES.PRINTER instead, you would automatically get a white background.

A big difference between STYLES.PRINTER and STYLES.DEFAULT is that STYLES.DEFAULT was -designed- primarily for HTML output. STYLES.PRINTER, on the other hand was -designed- to be the style template used by default for ODS PDF (and other PRINTER-family destinations [like PS, PCL, etc]).

If you look at STYLES.PRINTER, you will see that it ALSO inherits from STYLES.DEFAULT, however, it has many, many more changes than just a change to the FONT section. So if you want to get the ENTIRE look and feel of what was originally designed for the PRINTER destinations, then you should have parent=styles.printer ... or just cut and paste the whole, existing STYLES.PRINTER template into your editor window and change the font section (in which case, the parent would be STYLES.DEFAULT, but all the rest of the changes would be as designed for PDF).

So, that should take care of your gray background problem.

Your other issue, of why you are getting that "Continuing" message probably has something to do with ODS LAYOUT and the difference between the calculated physical page size and the logical page size. Since ODS LAYOUT is pre-production and has changed between 9.1.3 and 9.2, you might not find the exact answer you want in this paper, but it's a good place to start:
http://support.sas.com/resources/papers/proceedings10/011-2010.pdf

Otherwise, your best resource for ODS LAYOUT issues/difficulties is to work with Tech Support on this part of your question.

cynthia
N/A
Posts: 0

Re: Ods pdf

Is it possible to restore stles.deafult under sashelp.tmplmst?? I was trying some changes & by mistake I made it to store at sashelp.tmplmst. I want the original styles.default features which is now changed permanently. Any help???
SAS Super FREQ
Posts: 8,740

Re: Ods pdf

Hi

You might want to check with Tech Support -- I believe they have a few ways that they suggest "fixing" (or recreating) a corrupted sashelp.tmplmst -- depending on your version of SAS.

Prevention is the best cure for this -- which is the primary reason for ALWAYS using an access mode of read for sashelp.tmplmst (I know...it is a hard lesson to learn).

Cynthia
Occasional Contributor
Posts: 11

Re: Ods pdf

you can set ps and ls options before ods.
SAS Super FREQ
Posts: 8,740

Re: Ods pdf

Linesize (LS) and Pagesize (PS) are LISTING only options. They have no impact on PDF output.

The only options that impact PDF are the SAS system options for margin settings, and obvious ones like NODATE, NONUMBER, CENTER, etc.
N/A
Posts: 0

Re: Ods pdf

Hi

As Cynthia had mentioned to you and have already replied to another post link below:
http://support.sas.com/forums/message.jspa?messageID=36259&tstart=0
the post has important links that you may want to refer.

My fav is using the ODS Layout to create PDF documents and Reports.
http://www2.sas.com/proceedings/sugi31/159-31.pdf

this would need some effort initially but gives you much more flexibility for creating the PDF documents in future.

Regards
Surya
Ask a Question
Discussion stats
  • 8 replies
  • 719 views
  • 0 likes
  • 3 in conversation