Chapter Contents

Previous

Next
The GPRINT Procedure

Example 1: Specifying Color Text


Procedure features:
GPRINT procedure options:
CTEXT=
Other features:
GOPTIONS statement
TIMEPLOT procedure
Sample library member: GR22N01

This example creates the REFLIB.DOWHLC data set and generates a graph with color text from output that is produced by the TIMEPLOT procedure. The TIMEPLOT procedure is not a graphics procedure and produces text output only. (See SAS Procedures Guide for details on the TIMEPLOT procedure.)

The first part of this example uses the TIMEPLOT procedure with the newly created REFLIB.DOWHLC data set as input to produce SAS Output from the TIMEPLOT Procedure:

SAS Output from the TIMEPLOT Procedure
     date      min                                                             max
               6310                                                           6960
              *------------------------------------------------------------------*
02JAN1997     | l-----------c------h           |                                 |
03JAN1997     |             l---------c----h   |                                 |
06JAN1997     |                    l-----c-----|-h                               |
07JAN1997     |                 l-----------c-h|                                 |
08JAN1997     |                    l---c-------|-h                               |
09JAN1997     |                     l----------c----h                            |
10JAN1997     |                      l---------|------c--h                       |
13JAN1997     |                                | l-----c-----h                   |
14JAN1997     |                                |     l------c-----h              |
15JAN1997     |                                |   l-----c------h                |
16JAN1997     |                                |     l-------c----h              |
17JAN1997     |                                |         l---------c--h          |
20JAN1997     |                                |              l-----@            |
21JAN1997     |                                |             l----------c----h   |
22JAN1997     |                                |                l----c-----h     |
23JAN1997     |                                |        l---c------------------h |
24JAN1997     |                                l------c---------h                |
27JAN1997     |                             l--|--c--------h                     |
28JAN1997     |                              l-|--c---------------h              |
29JAN1997     |                                l---h------c                      |
30JAN1997     |                                |        l---------c--h           |
31JAN1997     |                                |             l---c---------h     |
              *------------------------------------------------------------------*

The second part of this example takes the output generated by the TIMEPLOT procedure and converts it to a graph by using the GPRINT procedure. GPRINT Procedure Output with Enhanced Text (GR22N01) shows the graph with color text, a title, and a footnote:

GPRINT Procedure Output with Enhanced Text (GR22N01)

[IMAGE]

 Note about code
libname reflib 'SAS-data-library';
goptions reset=global border cback=white
         colors=(black blue green red)
         ftitle=swissb htitle=3pct
         htext=.8 ftext=none
         hsize=7in vsize=5in;
 Note about code
filename out 'external-file';
 Note about code
data reflib.dowhlc;
   input date date9. high low close;
   format date date9.;
   datalines;
02JAN1997   6511.38  6318.96  6442.49
03JAN1997   6586.42  6437.10  6544.09
...more data lines...
30JAN1997   6845.03  6719.96  6823.86
31JAN1997   6912.37  6769.99  6813.09
;
 Note about code
options nodate nonumber linesize=80 pagesize=60;
 Note about code
proc printto print=out new;
run;
 Note about code
proc timeplot data=reflib.dowhlc;
   plot low close high / overlay hiloc ref=mean(low)
                         npp axis=6310 to 6960 by 10;
   id date;
run;
 Note about code
proc printto;
run;
 Note about code
title 'TIMEPLOT of Dow-Jones Averages';
footnote h=3 pct f=swiss
         j=l ' L=Low' ' C=Close' ' H=High'
         j=r 'GR22N01 ';
 Note about code
proc gprint fileref=out ctext=red;
run;


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.