Hi. I have this code for a proc report:
ods pdf notoc file="F:\TEST.pdf" ;
options orientation=landscape;
TITLE1 j=l color=STEEL bold 'XXXXX' ;
TITLE2 j=l color=black bold 'XXXXX';
options mprint;
proc format;
/*value pctf .='N/A' waittime percentn10. low-<0.1= 0.1-high=waittime format=percentn10.*/;
value colorf .=white low-<0.1=Firebrick 0.1-high=lightblue;
run;
%macro many_col;
proc sql noprint;
select count(distinct dato) into :ncols from pdf1;
quit;
%put &=ncols;
proc report data=pdf1 style(header) = {background = lightgray color = black};
columns region place metode dato,waittime ;
define Region/group style(header) = {background = lightgray color = black font_weight=bold font_face=calibri } style(column) = {background = lightgray color = black font_weight=bold font_face=calibri Cellwidth=70};
define place /group style(header) = {background = lightgray color = black font_weight=bold font_face=calibri} style(column) = {background = lightgray color = black font_face=calibri };
define metode/group '' style(header) = {background = lightgray color = black font_weight=bold font_face=calibri} style(column) = {background = lightgray color = black font_face=calibri};
define dato/across order=internal format= ddmmyyd10. style(header) = {background = lightgray color = black font_weight=bold font_face=calibri};
define waittime /sum format=percentn10./*format=pctf5. */'';
compute waittime ;
%do i=1 %to &ncols;
call define("_c%eval(&i+3)_",'style','style={background=colorf. color=black font_face=calibri font_weight=bold}');
%end;
endcompute;
run;
%mend;
%many_col
ods pdf close;
My report shows titles in all pages, but I only need it on the first page - how can I do so?
Second question: My report comes out very long because a have a set of dates across the table in the output which do not fit in PDF on a single page or two - I tried to correct the cellwidth on the other group variables, but if I change to cellwidth=20, then it will look good in the result window - but come out messy in the PDF.
Is there any tips and tricks to make the final output prettier?
Have you worked with PROC ODSTEXT?
I don't know if you might tweak the font size/style to your liking...
/*TITLE1 j=l color=STEEL bold 'XXXXX' ;*/
/*TITLE2 j=l color=black bold 'XXXXX';*/
proc odstext;
p 'XXXXX' /style=[color=steel font_weight=bold fontsize=16pt];
p 'XXXXX' /style=[color=black fontsize=14pt];
run;
Hi,
One way to keep using the SAS TITLE statement and only having titles on the first page is to use OBS= and FIRSTOBS= - -as shown with SASHELP.CARS:
This paper talks about how to make wide output fit in the PDF destination. You can change font, cellpadding and other attributes to make output fit better: https://support.sas.com/resources/papers/proceedings14/SAS038-2014.pdf
Hope this helps,
Cynthia
Hi is it possible to get titles on the first page only and on another specific page also?
so the title should appear two times in the report?
I have 2 different proc reports that I outout in 1 PDF, and on the first page I want a title as you showed - it worked, but then I want a title when the second report starts
is that possible
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.
Find more tutorials on the SAS Users YouTube channel.