BookmarkSubscribeRSS Feed
deleted_user
Not applicable
I need to put an image at the top of a page. I have the following code:

ods pdf file= "C:\PC_SAS\GRAPH_PAGE4.pdf" startpage=never;
ods escapechar='^';
goptions hsize=3.0 in vsize=3.0 in
ftext='Ariel' htext=2 gunit=pct;
symbol1 v=dot i=join;
proc gchart data=example7;
goptions horigin=0 in vorigin=7.50 in;
title2 'Graph 1 ';
pie3d flavor / sumvar=calories noheading
fill=solid
slice=none
value=outside
clockwise coutline=BL legend=legend1
explode="Apple" "Blueberry";
legend1 label=none position=(left middle) offset=(2, 4) across=1
order=("Apple" "Blueberry") ;
pattern1 color=CX0000FF ;
pattern2 color=CXFF8000 ;
symbol1 interpol=join width=10
font=swiss value=-;
run ;
quit ;

Would it need to go into the ODS statement?
2 REPLIES 2
Cynthia_sas
Diamond | Level 26
Hi:
When you say that you need to put an image at the top of a page -- do you mean another SAS/GRAPH image or do you mean an image like a company logo???

If you mean a logo, this Tech Support note explains how to do it:
http://support.sas.com/kb/22/245.html

If you need to have a separate SAS/GRAPH image together with the output from the GCHART step, you should investigate PROC GREPLAY.

cynthia
deleted_user
Not applicable
It was for a company logo. I used the osds pdf an inserted the image there, but it shows on all 4 graphs. Is there a work around for that?

ods pdf file= "C:\PC_SAS\GRAPH_PAGE4.pdf" startpage=never;
ods escapechar='^';
ods pdf text='^S={preimage="D:\Documents and Settings\amrapon\Desktop\Report\Logo For Top Of Report.jpg"}';
ods pdf text=' ';
ods pdf text=' ';
goptions hsize=3.0 in vsize=3.0 in
htext=2 gunit=pct;
symbol1 v=dot i=join;
proc gchart data=example7;
goptions horigin=0 in vorigin=7.50 in;
title2 'Graph 1 ';
pie3d flavor / sumvar=calories noheading
fill=solid
slice=none
value=outside
clockwise coutline=BL legend=legend1
explode="Apple" "Blueberry";
legend1 label=none position=(left middle) offset=(2, 4) across=1
order=("Apple" "Blueberry") ;
pattern1 color=CX0000FF ;
pattern2 color=CXFF8000 ;
symbol1 interpol=join width=10
font=swiss value=-;
run ;
quit ;

proc gchart data=example6 ;
goptions horigin=0 vorigin=3.99 in;
title2 'Graph 2';
pie3d flavor / sumvar=calories noheading
fill=solid
slice=none
value=outside
clockwise coutline=BL legend=legend1
explode="Apple" "Blueberry" "Peach" "Cherry" "Pecan";
legend1 label=none position=(left middle) offset=(2, 4) across=1
order=("Apple" "Blueberry" "Peach" "Cherry" "Pecan") ;
pattern1 color=CX0000FF ;
pattern2 color=CX00FF00 ;
pattern3 color=CXFF0000 ;
pattern4 color=CXFF8000 ;
pattern5 color=CXFFFF00;
symbol1 interpol=join width=10
font=swiss value=-;
run ;
quit ;


proc gchart data=example6 ;
goptions horigin=4 in vorigin=7.50 in ;
title2 'Graph 3';
pie3d flavor / sumvar=calories noheading
fill=solid
slice=none
value=outside
clockwise coutline=BL legend=legend1
explode="Apple" "Blueberry" "Peach" "Cherry" "Pecan";
legend1 label=none position=(left middle) offset=(2, 4) across=1
order=("Apple" "Blueberry" "Peach" "Cherry" "Pecan") ;
pattern1 color=CX0000FF ;
pattern2 color=CX00FF00 ;
pattern3 color=CXFF0000 ;
pattern4 color=CXFF8000 ;
pattern5 color=CXFFFF00;
run ;
quit ;

proc gchart data=example8 ;
goptions horigin=4 in vorigin=3.99 in;
title2 'Graph 4';
pie3d flavor / sumvar=calories noheading
fill=solid
slice=none
value=outside
clockwise coutline=BL legend=legend1
explode="Apple" "Blueberry" "Cherry";
legend1 label=none position=(left middle) offset=(2, 4) across=1
order=("Apple" "Blueberry" "Cherry") ;
pattern1 color=CX0000FF ;
pattern2 color=CXFF8000 ;
symbol1 interpol=join width=10
font=swiss value=-;
run ;
quit ;

ods pdf close;

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 2 replies
  • 1005 views
  • 0 likes
  • 2 in conversation