BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
PaigeMiller
Diamond | Level 26

Let's suppose I want to put two tables on one page using ODS PDF. Each table is to have a different title. If I use this code, the second table's title doesn't appear (as shown in the attachment). What am I doing wrong?

 

ods pdf file="&cdu\temp.pdf" startpage=no;
title "SASHELP.CARS";
title2 "First 10 Rows";
proc print data=sashelp.cars(obs=10);
	id make model;
	var msrp mpg_highway;
run;
title "SASHELP.CARS";
title2 "Second 10 Rows";
proc print data=sashelp.cars(firstobs=11 obs=20);
	id make model;
	var msrp mpg_highway;
run;
ods pdf close;

 

--
Paige Miller
1 ACCEPTED SOLUTION
7 REPLIES 7
Reeza
Super User
Issue replicated on SAS 9.4 TS1M3.

ODS TEXT does function as a workaround but you'd have to customize the format/style which is annoying.
PaigeMiller
Diamond | Level 26

Thank you @Miracle and @Reeza.

 

This now works

 

ods escapechar='^';
ods pdf file="&cdu\temp.pdf" startpage=no; ods pdf text = "^{style [just=center font=(Arial) fontsize=11pt fontweight=bold color=verydarkstrongblue] SASHELP.CARS}"; ods pdf text = "^{style [just=center font=(Arial) fontsize=11pt fontweight=bold color=verydarkstrongblue] First 10 Rows}"; proc print data=sashelp.cars(obs=10); id make model; var msrp mpg_highway; run; ods pdf text = "^{newline 2}"; ods pdf text = "^{style [just=center font=(Arial) fontsize=11pt fontweight=bold color=verydarkstrongblue] SASHELP.CARS}"; ods pdf text = "^{style [just=center font=(Arial) fontsize=11pt fontweight=bold color=verydarkstrongblue] 2nd 10 Rows}"; proc print data=sashelp.cars(firstobs=11 obs=20); id make model; var msrp mpg_highway; run; ods pdf close;

Okay, I went a little crazy with the style options, but when you have a new toy, you play with it ...

 

--
Paige Miller
Reeza
Super User

Don't know if this is useful, but recently realized you can specify colours in SAS using 

 

CX[HEXCOLOUR] which works great when trying to match company styles:

 

ods pdf text = "^{style [just=center font=(Arial) fontsize=11pt fontweight=bold color=Cx00aad2] First 10 Rows}";
%let cdu = C:\_localdata\temp;

ods escapechar='^';
ods pdf file="&cdu\temp.pdf" startpage=no;
ods pdf text = "^{style [just=center font=(Arial) fontsize=11pt fontweight=bold color=cxff7900] SASHELP.CARS}";
ods pdf text = "^{style [just=center font=(Arial) fontsize=11pt fontweight=bold color=cxd40072] First 10 Rows}";
proc print data=sashelp.cars(obs=10);
	id make model;
	var msrp mpg_highway;
run;
ods pdf text = "^{newline 2}";
ods pdf text = "^{style [just=center font=(Arial) fontsize=11pt fontweight=bold color=Cx00aad2] SASHELP.CARS}";
ods pdf text = "^{style [just=center font=(Arial) fontsize=11pt fontweight=bold color=Cx00aad2] 2nd 10 Rows}";
proc print data=sashelp.cars(firstobs=11 obs=20);
	id make model;
	var msrp mpg_highway;
run;
ods pdf close;
PaigeMiller
Diamond | Level 26

This is mostly off-topic, but how would I know what my company logo color is in CX notation?

--
Paige Miller
Reeza
Super User

My company has a corporate style guide courtesy of communications.

 

Another way is to go the to company website, use the web developer tools, check the CSS (cascading style sheet) for the colours used for common things, ie text, possibly logo, specific headings etc. 

ballardw
Super User

@PaigeMiller wrote:

This is mostly off-topic, but how would I know what my company logo color is in CX notation?


It may be easier to use CMYK if your organization has a Pantone Color look up somewhere for a printing documents.

The SAS color code would look like: CMYKccmmyykk where

cc is the cyan component.

mm is the magenta component.

yy is the yellow component.

kk is the black component.

 

 
The components are hexadecimal numbers in the range 00–FF, where higher values are darker and lower values are brighter. This scheme allows for up to 256 levels of each color component.

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
  • 2520 views
  • 8 likes
  • 4 in conversation