Sample 25502: Scaling data-dependent output using PROC GANNO
This sample is from the "SAS/GRAPH Software: Reference, Version 8", Volume 1, Chapter 12.
For additional information on the sample refer to this book.
/*+-------------------------------------------------------------+
| S A S S A M P L E L I B R A R Y |
| |
| NAME: GANSCALE |
| TITLE: GANSCALE-Scaling Data-Dependent Output |
| PRODUCT: GRAPH |
| SYSTEM: ALL |
| KEYS: GRAPHICS ANNOTATE GANNO |
| PROCS: GANNO |
| DATA: INTERNAL |
| |
| SUPPORT: GRAPHICS STAFF UPDATE: |
| REF: SAS/GRAPH REFERENCE GUIDE |
| MISC: |
| |
+-------------------------------------------------------------+*/
/* Set the graphics environment */
goptions reset=all gunit=pct cback=white
colors=(black blue green red);
/* Create data set of sales information */
data wrldtotl;
length sitename $ 10;
input sitename $ 1-10 mean 12-15;
datalines;
Paris 999
Munich 571
Tokyo 137
London 273
Frankfurt 546
New York 991
;
/* Create Annotate data set */
data wrldanno;
length function color $ 8 text $ 20;
retain line 0 xsys ysys '2' hsys '3' x 8;
set wrldtotl end=end;
/* Position the cursor at the beginning point */
function='move'; x=x+8; y=20; output;
/* Draw bars representing number of sales */
function='bar'; y=y+(mean); x=x+9;
style='empty'; color='red'; output;
/* Label the bars with name of site */
function='label'; y=0; x=x-4; size=3.5;
position='E'; style='swiss';
color='blue'; text=sitename; output;
/* Label the bars with the value of MEAN */
function='move'; y=y+(mean)-3; output;
function='label'; x=x-1; text=left(put(mean,3.));
position='5'; style='swiss'; size=3; output;
/* At end of data set, add an axis line, */
/* title, footnote, and frame */
if end then do;
/* Draw a blue axis line */
function='move'; x=10; y=20; output;
function='draw'; x=90; y=20; line=1;
size=.5; color='blue'; output;
/* Write the title */
function='label'; x=50; y=95; text='Projected Sales';
xsys='3'; ysys='3'; position='5'; style='swissb';
size=5; color=' '; output;
/* Write the footnote */
x=92; y=5; size=3; style='swiss'; text='GANSCALE'; output;
/* Draw a frame */
function='frame'; color='blue'; when='b';
style='empty'; output;
end;
run;
/* Display the annotation, scaling */
/* the data with the DATASYS option */
proc ganno annotate=wrldanno
datasys;
run;
quit;

This example uses an Annotate data set to scale data-dependent output with the DATASYS option and create a vertical bar chart of sales for each of six sites.
| Type: | Sample |
| Topic: | SAS Reference ==> Procedures ==> GANNO
|
| Date Modified: | 2005-07-20 03:02:43 |
| Date Created: | 2005-05-23 14:11:44 |
Operating System and Release Information
| SAS System | SAS/GRAPH | All | 8 TS M0 | n/a |