BookmarkSubscribeRSS Feed
HabAM
Quartz | Level 8

I have an image in my title statement but can't contain it to the first page. 

 

I have tried to clear it with title; but didn't work.

 

Any comments/advice is much appreciated:

 

title j=l '^S={preimage="H:\*.png"}'
j=c 'xxxxxxxxxxxxxxxxxxxx'
j=c "  &StartDate. to &EndDate.";

HabAM
7 REPLIES 7
Reeza
Super User

I have tried to clear it with title; but didn't work.

What does that mean?

 

Is the image too big to fit on one page or is it appearing on multiple pages even though it's small enough to fit on one page. If it's too big you'll need to resize it first.

Cynthia_sas
SAS Super FREQ

Hi:
I am not sure that *.png is a valid file name. Can you show a picture of what you mean when you say "you cannot contain it to the first page"?

A SAS TITLE statement is global. So if your procedure output produces multiple pages of output, then the TITLE statement would be in effect for the entire procedure and would appear on multiple pages. You cannot "clear" a title page in the middle of a procedure. You did not show any other code except for the title statement and I wonder whether you have a multi-page PDF output and you only want the preimage on page 1.

cynthia

 

Since I don't know what SAS Options or ODS PDF options you have in place, I just ran a little test using SASHELP.SHOES. I don't have an image on this machine to use, but I put a placeholder in the code. Right now, in this type of multi-page output, you cannot "reset" the title between pages. You can only reset the title between procedure steps.

%let startdate = 01jan2018;
%let enddate = 15feb2018;
 
ods pdf file='c:\temp\test_title.pdf';
title j=l 'preimage here'
      j=c 'xxxxxxxxxxxxxxxxxxxx'
      j=c "  &StartDate. to &EndDate.";
 
proc print data=sashelp.shoes(obs=100);
run;
ods pdf close;

Or else, you have to do something like display the first 35 observations on page 1 with the preimage and then display the rest of the observations after resetting the title. Something like this:


%let startdate = 01jan2018;
%let enddate = 15feb2018;
 
ods pdf file='c:\temp\alt_title.pdf';
title j=l 'preimage here'
      j=c 'xxxxxxxxxxxxxxxxxxxx'
      j=c "  &StartDate. to &EndDate.";
 
proc print data=sashelp.shoes(obs=35);
run;

title 'New Title starts on page 2';
proc print data=sashelp.shoes(firstobs=36 obs=100);
run;
ods pdf close;

(you might have to fiddle with the obs= and firstobs= depending on your margin settings. My page got approx 35 obs per page using PROC PRINT.

HabAM
Quartz | Level 8

 

 

Here is part of the code I use. Its not that the image is large or small, it places the same image on the next page and still outputs my SGPLOT graph on top of the image. see image attached ..

 

 

ods listing close;
option nodate nonumber;
ODS PDF file="H:\* &dt..pdf" style=color
STARTPAGE=NEVER;
ODS escapechar="^";

title j=l '^S={preimage="H:\*.png"}'
j=c 'xxxxxxxxxxxx'
j=c " &StartDate. to &EndDate.";

ods layout start height=2.2in width=8in ;
options orientation=portrait
papersize = letter
topmargin=.5in bottommargin=.25in
leftmargin=.25in rightmargin=.25in;
ODS noproctitle;


ODS REGION ;
ODS PDF text="^S={just=l font_size=12pt font_weight=bold font_face=Arial}Summary:";
ODS PDF text="^S={width=100% just=J font_size=12pt font_face=Arial }&summary.";
ods layout end;
ods layout gridded columns=2 column_widths=(50% 50%) column_gutter=.25in ;
ODS REGION x=0in ;
ods graphics on / reset noborder height=3.5in;

 

PROC REPORT DATA = age nowd style(header)=[foreground=white background=steel font_weight=bold];
.......
title1 "^S={just=l font_size=10pt font_face=Arial font_weight=bold}Table 1: xxxxxx ( &WeekFrom., &YearFrom to Week &WeekTo., &YearTo)";
run;

 

.....

Multiple proc statements

.....

ODS Layout end;


ods pdf close;

HabAM
Cynthia_sas
SAS Super FREQ
Hi: You have a preview of Excel but your code is ODS PDF with ODS LAYOUT and ODS REGION statements. For help debugging ODS PDF with ODS LAYOUT and ODS REGION, your best resource might be to open a track with Tech Support. ODS LAYOUT and ODS REGION are only supported by ODS PDF and ODS HTML, so I do not believe they will work with ODS EXCEL.

cynthia
HabAM
Quartz | Level 8

I did a screenshot. Please see the actual output.

HabAM
Cynthia_sas
SAS Super FREQ
Hi:
Again, you don't show all your code, nor explain what is INSIDE your PROC REPORT, nor what code is putting the figures on the page. If you have a procedure step for every figure or every 2 figures, then you should be able to reset the title statement:
title;
between the procedure that does Figure 2 at the end of page 1 and the procedure that does Figure 3 and 4 at the top of page 2.

Otherwise, I suggestion working with Tech Support, as they can look at ALL your code and make a more constructive suggestion.

cynthia
HabAM
Quartz | Level 8
Thank you Cynthia
HabAM

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 7 replies
  • 3013 views
  • 0 likes
  • 3 in conversation