The SAS Output Delivery System and reporting techniques

Text only charts/graphs

Reply
N/A
Posts: 0

Text only charts/graphs

Hello,

I have a 7 page pdf, currently done using SAS/EXCEL/Adobe Acrobat, which I wish to automate/productionize using only SAS. Slide one is a title page with variable date range, variable Client Name and a picture of a logo.
Slide 2 is text only. Slide 3 is a pie chart, Slide 4 is a bar chart, Slide 5 is combination table/text. Slide 6 is text only, Slide 7 is text only with superscripts.

I have the pie and hbar and table with text figured out. These 3 go to a pdf file using ods.

I cannot figure out the text only, with formatting and macro variables and the logo.

Suggestions appreciated.

Michelle Z.
Super Contributor
Super Contributor
Posts: 3,174

Re: Text only charts/graphs

Posted in reply to deleted_user
A Google advanced search at the SAS support website http://support.sas.com/ using the following arguments revealed several interesting SAS technical (SUGI/SGF user conference) papers on this topic:

combine text graphics pdf document site:sas.com

Scott Barry
SBBWorks, Inc.
SAS Super FREQ
Posts: 8,868

Re: Text only charts/graphs

Posted in reply to deleted_user
Hi:
The program below makes a SAS dataset that contains the lines which will appear on the title page. ODS ESCAPECHAR is used to set the font and weight for most of the lines. Then, Proc Report is used to print out the dataset with everything right-justified, with no interior table lines and using several different fonts.

The second Proc Report step just produces a one page report -- the key thing is how the title page data set is created and then sent to ODS PDF. And, you'd probably disappear the Proc Print once you are comfortable with how the title data set would be created.

cynthia
[pre]
options nodate nonumber
linesize=256 orientation=portrait;
ods listing;

data work.title;
** this data step creates a file called work.title;

drop i;
length line $200;
do i = 1 to 6 by 1;
line = ' ';
output;
end;
line = "~S={background=black cellheight=1pt font_size=1pt cellpadding=0}"
||' '||"~S={}";

output;
line = "Some Title Page for the Report";
output;
line = '~S={font_size=18pt}'
||'Some Other Line ~S={}';
output;
line= 'Report Period from 07/01/2008 to 09/30/2008 ';
output;
line = "~S={background=black cellheight=1pt font_size=1pt cellpadding=0}"
||' '||"~S={}";

output;
do i = 1 to 5 by 1;
line = ' '; output;
end;
line = '~S={font_size=12pt font_face=Courier}'
||'October 31,'||'~_'||'2008'
||'~S={}';
output;
line = '~S={font_size=12pt font_face=Courier}'
||'Investigator: Some Person'
||'~S={}';
output;
line = '~S={font_size=12pt font_face=Courier}'
||'Analyst: Anne Analyst'
||'~S={}';
output;
run;

ods listing;
proc print data=work.title;
run;
ods listing close;

options leftmargin="1 in" topmargin="1 in" rightmargin="1 in";

** this proc report step prints work.title;
** created in the data step above;
ods pdf file='c:\temp\do_title_page.pdf' ;
ods escapechar='~';
title;
proc report data=work.title noheader nowd
style={rules=none frame=void just=r
cellspacing=0 cellpadding=4pt};
column line;
define line /right
style(column)={font_weight=bold
font_face=Arial
foreground=black};
run;

proc report data=sashelp.shoes nowd;
column Region n pctn;
define Region/group;
define n /'Count';
define pctn /'Percent' f=percent8.2;
run;

ods pdf close;
[/pre]
N/A
Posts: 0

Re: Text only charts/graphs

Posted in reply to Cynthia_sas
Cynthia,

My pie chart shows the percentages with 2 decimal places automatically. I would like them to display as whole number percentages, please.

Thank you for your time.
SAS Super FREQ
Posts: 8,868

Re: Text only charts/graphs

Posted in reply to deleted_user
Hi, Michelle:
As explained here -- by default PIE charts do their own "thing" when calculating the number of decimal places: http://support.sas.com/kb/00/628.html

To circumvent this behavior, you need to take control of the percentages by calculating them yourself, as described in this Tech Support note:
http://support.sas.com/kb/24/877.html

For more help with this task or how to modify your existing code to get the graph that you want, you might consider contacting Tech Support for help with your specific needs. Especially, since, depending on the device driver you use, you may or may not have percent problems:
http://support.sas.com/kb/1/725.html

In addition, this paper talks exclusively about generating PIE charts and might prove useful:
http://www2.sas.com/proceedings/forum2008/071-2008.pdf

cynthia
Super Contributor
Posts: 292

Re: Text only charts/graphs

Posted in reply to Cynthia_sas
This interest in producing pie charts counters my interest in and passion for good data visualization (presentation). I'd encourage you to read the linked article as an aid to ensuring that your clients are getting the best possible message from the data that you've carefully collected.

http://www.perceptualedge.com/articles/visual_business_intelligence/save_the_pies_for_dessert.pdf
N/A
Posts: 0

Re: Text only charts/graphs

Posted in reply to deleted_user
Thank you Cynthia, that is a very elegant solution.
N/A
Posts: 0

Re: Text only charts/graphs

Posted in reply to deleted_user
Cynthia,

I have most of my chart issues worked out. The font verdana is used for the text only charts without any problems.

I'm still having an issue with fonts inside the gchart procedure. I'm using verdana font in the titles, footnotes, and annotated text, which works fine. The font for the major tick marks in the case of an hbar chart (x axis and yaxis), and the percentages in the case of the pie are automatically switched to simplex font. The font is correct for the legend as well.

I've looked at the support db and am unable to fix this issue.

Tried:
goptions ftext=verdana;

Thank you for your suggestions.

Michelle Z.
N/A
Posts: 0

Re: Text only charts/graphs

Posted in reply to deleted_user
Solved the fonts for the axis tick marks using value=(font=verdana) on the axis statement.

Now just the pie percentages....

Michelle
Ask a Question
Discussion stats
  • 8 replies
  • 322 views
  • 0 likes
  • 4 in conversation