BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
Anita_n
Pyrite | Level 9

Dear all, 

I have this code 

 

ods region;
title1 h=8pt color=dimgray "Baseball players";
title3 h=6pt color=dimgray "players by league";

ods pdf file="test.pdf" startpage=never style=journal;  

ods layout gridded  columns=2 rows=2 advance=proc column_gutter=0.1in row_gutter=0.1in;
ods graphics / width=3.5in noborder;

title3 " ";
title1 " ";
 proc sgplot data=sashelp.baseball;
 where league = "American";
 vbar team / response=nruns group=division;
 run;

proc sgplot data=sashelp.baseball;
 where league = "American";
 vbar team / response=nruns group=division;
 run;

ods layout end;

ods region;
ods graphics / width=3.5in  noborder ;
ods layout gridded columns=2 rows=2 advance=proc column_gutter=0.1in row_gutter=0.1in;


proc sgplot data=sashelp.baseball;
 where div = "NE";
 vbar team / response=nruns group=division;
 run;

proc sgplot data=sashelp.baseball;
 where div = "NW";
 vbar team / response=nruns group=division;
 run;
ods layout end;

ods pdf close;






and wish to remove the title (the title should be on the first page but not on the second page) from the second page. I don't really know my this is not working. Please help

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

Still don't see how you get two pages.

 

Easiest may be to use either ODS TEXT or possibly Proc ODSTEXT to place text when wanted instead of title statements.

 

Ods text='Line of text';

 

 

View solution in original post

3 REPLIES 3
ballardw
Super User

When I run your code there is only one page created so I do not understand your comment about pages.

Perhaps you may not be clear on what Startpage=never does.

NEVER
specifies not to insert page breaks, even before graphics procedures.

There would also tend to be interactions with layout instructions. I won't claim to be an expert on those as I don't use PDF very often.

 

To clear titles you use something like

title;

If you provide a value in quotes then you create title of blanks, you don't clear them. The above will clear the title1 and all higher numbered title lines. You do not need to address each title to clear it. Example: Title3; would clear title lines 3 through 10, if present but leave 1 and 2 alone.

Anita_n
Pyrite | Level 9
I have two pages. I just wanted to leave the title in page 1 and delete it from page2 but it doesn't even work with title;
as you suggested.
All the way, thankyou.
ballardw
Super User

Still don't see how you get two pages.

 

Easiest may be to use either ODS TEXT or possibly Proc ODSTEXT to place text when wanted instead of title statements.

 

Ods text='Line of text';

 

 

sas-innovate-white.png

Register Today!

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.

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 769 views
  • 0 likes
  • 2 in conversation