Chapter Contents |
Previous |
Next |
SAS Companion for the OS/2 Environment |
See SAS/GRAPH Software: Reference for full details about using SAS/GRAPH software. Also see Overview of Graphics Considerations for further details about using graphics and fonts with the SAS System under OS/2.
Producing Graphics on Your Display |
Here is a simple example of how to produce a graphic:
data hat; do x=-5 to 5 by .25; do y=-5 to 5 by .25; z=sin(sqrt(x*x+y*y)); output; end; end; proc g3d data=hat; plot y*x=z/ctop=red; title 'Cowboy Hat with G3D'; run; quit;Cowboy Hat Procedure Output shows the output for this program:
If you use the DEVICE= option in the GOPTIONS statement to route your graphics to a hardcopy device, and then you want to return to using your monitor to display graphics, you must specify a driver. Submit the following statement to display graphics output on your monitor:
goptions device=win;
You should also use the WIN device driver to produce graphics on your display when you run your SAS job in batch mode.
If you specify that your program output is to be displayed in HTML, your graphic is converted to a .GIF file and stored in the same folder as your SAS System data set. For more information, see The Complete Guide to the SAS Output Delivery System.
Printing Graphics |
You can use two methods to print output from SAS/GRAPH:
After SAS prepares output for a printer (by using either OS/2 printer drivers or a SAS/GRAPH printer driver), the output is sent to the OS/2 printer, which then queues it for printing on the device of your choice. SAS/GRAPH Generic Printer Drivers Compared with SAS/GRAPH Native Printer Drivers illustrates how you can use the two sets of printer drivers within SAS/GRAPH to produce output for a given device.
SAS/GRAPH Generic Printer Drivers Compared with SAS/GRAPH Native Printer Drivers
The method that you choose depends on the output device
that you are using; see Choosing between a SAS/GRAPH Native Driver and the OS2Pxxx Driver
for more information. You can control both graphics printing methods by using
either the Print and Print Setup dialog boxes or the SYSPRINT= option and
the GOPTIONS DEVICE= statement.
To print a graphic by using the SAS/GRAPH generic device drivers with the OS/2 printer drivers:
Alternatively, you can use the SYSPRINT system option to assign the destination printer. For example,
options sysprint='HP LaserJet III';Note that you may assign only printer driver names that have been previously configured in OS/2.
GOPTIONS DEVICE=OS2Pxxx; |
The orientation of graphics output is determined by the following:
goptions rotate=landscape;Then the output is oriented as landscape, regardless of the settings in the Print Setup dialog box.
Note: Graphics printing is affected by the margins that
are specified in the Page Setup dialog box. If you modify the margins when
printing graphics and your intention is to keep the graphics proportional,
be sure the change the top and bottom margins by the same amount that you
change the left and right margins.
PS | produces Postscript output. |
HPLJS3 | produces output in the PCL5 language that is used by Hewlett-Packard LaserJet III printers. |
HP7550 | produces HPGL output that is used by Hewlett-Packard 7550 plotters. |
After the SAS/GRAPH native printer driver has produced output in the native language of the target device, SAS then routes the output to the device that uses the OS/2 printer. The SAS System bypasses the OS/2 driver that is currently associated with the target device, but it does respect the destination that is specified in the Print Setup dialog box when deciding where to send the output.
To print a graph by using a SAS/GRAPH printer driver, run your SAS/GRAPH program with the following graphics options:
GOPTIONS DEVICE= driver-name; |
goptions device=hpljs2;This statement formats the graph for the Hewlett-Packard LaserJet Series II printer. You can view the complete list of SAS/GRAPH drivers by submitting the PROC GDEVICE statement.
To print a graph to a printer file (also called a graphics stream file, or GSF) instead of directly to a printer, use the GSFNAME option in the GOPTIONS statement and use a filename or fileref to specify where you want the output. For example:
filename graphout "graphpic.prn"; goptions gsfname=graphout gsfmode=replace device=hpljs2;
GOPTIONS TARGETDEVICE= driver-name; |
By specifying a target device, SAS/GRAPH can format the graph with colors and attributes that are appropriate for the target printer. To print the graph after it is displayed, select Print from the File menu.
Note: If you do not specify a target device before you
create the graph, SAS/GRAPH will prompt you (in the Print dialog box) for
a device driver name when you attempt to print the graph that you are previewing.
In most cases the OS2PRTM or OS2PRTC driver is specified by default. The
graph colors, orientation, and sizing might not be optimal for the output
device you specify, however.
Importing Graphics from Other Applications |
You can import bitmap graphics into these SAS System windows:
The SAS System provides two ways to import bitmap graphics into SAS/GRAPH:
To import vector graphics, use the GIMPORT procedure to import computer graphics metafile (CGM) files. The imported files are stored as GRSEG catalog entries. This method preserves the individual graphic objects in the imported graph, whereas the other methods treat the imported graphic as a single (uneditable) bitmap. For more information about PROC GIMPORT, see SAS/GRAPH Software: Reference.
You can import graphics from other applications that produce files in any of the formats that are shown in Graphics Import File Formats.
Graphics File Format | File Extension |
---|---|
OS/2 bitmap | BMP |
OS/2 metafile | MET |
Device independent bitmap | DIB |
JPEG format | JPG |
graphic interchange format (GIF) | GIF |
tag image file format (TIFF) | TIF |
PC Paintbrush | PCX |
Truevision Targa | TGA |
Encapsulated PostScript Interchange (EPSI) | PS |
Portable Network Graphics | PNG |
Photo CD image | PCD |
Portable Pixmap | PBM |
X Window bitmap | XBM |
X Window dump | XWD |
To import bitmap graphics into SAS/GRAPH:
Note: Automatic file format detection through
using AUTO does not detect the DIB file format
You can also include IMAGE catalog entries in your graphs. For information about including IMAGE catalog entries, see SAS/GRAPH Software: Reference.
Exporting Graphics for Use with Other Applications |
You can also use SAS/GRAPH to
create GIF and VRML files
for use with Web browsers, PDF files for use with the Adobe Acrobat reader,
and many other useful types of graphics files. For more information about
how to create these types of files, see SAS/GRAPH Software: Reference and the online Help for SAS/GRAPH.
You can export graphics from SAS/GRAPH in any of the formats that are shown in Graphics Export File Formats.
Graphics File Format | File Extension |
---|---|
OS/2 bitmap | BMP |
OS/2 metafile | MET |
Device independent bitmap | DIB |
JPEG format | JPG |
graphic interchange format (GIF) | GIF |
tag image file format (TIFF) | TIF |
Adobe PostScript | PS |
Encapsulated PostScript Interchange (EPSI) | PS |
Portable Network Graphics | PNG |
Portable Pixmap | PBM |
To export a graph from the GRAPH window:
For more information about exporting graphics to a SAS
IMAGE catalog entry from the Image editor, see the online Help for SAS/GRAPH.
To copy information from SAS/GRAPH to the clipboard:
If you do not select an area of the graph to copy, the next step will copy the entire graph to the clipboard.
This copies the graph to the
clipboard. You can then
return to the target application and paste the graph (typically by using the Paste or Paste Special options in
the target OS/2 application). See the documentation for the target OS/2 application
for more information about how to paste information from the clipboard.
To create a CGM from SAS/GRAPH, set GOPTIONS as follows:
FILENAME fileref 'filename.CGM'; |
GOPTIONS DEVICE=CGMxxxx GSFNAME= fileref GSFMODE=REPLACE; |
The driver names that are marked with an asterisk (*) are already provided with Version 8 of the SAS System. For each driver that is not provided, the corresponding document describes how to build the driver.
Package | Suggested Driver | Document |
---|---|---|
Aldus PageMaker | CGMAPMA* | TS-252F |
Aldus Persuasion | CGMAPSA* | TS-252D |
BPS 35 MM Express | CGM35 | TS-252 |
Borland Quattro Pro (Windows) | CGMBQWC | TS-252J |
Borland Quattro Pro (DOS) | CGMBQA* | TS-252 |
CorelDRAW 5 | CGMCOR5L | TS-252R |
Frame Tech FrameMaker | CGMFRCA* CGMFRGA* CGMFRMA* PSCFRAME PSGFRAME PSMFRAME | TS-252H |
Harvard Graphics 2.12 for DOS | CGHHG | TS-252 |
Harvard Graphics 3.0 for DOS | CGMHG3A* | TS-252A |
Harvard Graphics for Windows | CGMHGWA* | TS-252C |
Harvard Graphics 3.0 for Windows | CGMHG3L | TS-252T |
ImageBuilder | CGMIMG | TS-252 |
Interleaf 5 | CGMCILFC* CGMGILFG* CGMMILFM* PSILEAFC PSILEAFG PSILEAFM | TS-252I |
Lotus Ami Pro 3.0 | CGMAM3C* CGMAM3G CGMAM3M | TS-252M |
Lotus Ami Pro 2.0 | CGMAMIA | TS-252 |
Lotus Freelance for DOS | CGMFLALJ* CGMFLAPL* CGMFLAPT* | TS-252 |
Lotus Freelance for Windows 2.0 | CGMFL2C* CGMFL2G CGMFL2M | TS-252K |
Lotus Freelance for Windows 1.0 | CGMFLWA* | TS-252 |
Lotus 1-2-3 4.0 | CGM123C* | TS-252N |
Lotus 1-2-3 | CGM123 | TS-252 |
Lotus Office 97 | CGMLOT97 CGMLT97P | TS-252Y |
Microsoft Word for Windows 6.0 | CGMMW6C* CGMMW6G CGMMW6M | TS-252L |
Microsoft Word for Windows 2.0 | CGMMWWC* | TS-252B |
Microsoft PowerPoint | CGMMPPA | TS-252E |
Microsoft Office 97 | CGMOFF97 CGMOF97P | TS-252X |
Polaroid CI3000 | CI3000 | TS-252 |
WordPerfect 5.1 for DOS | CGMWPCA CGMWPCAP* CGMWPGA CGMWPGAP* CGMWPMA CGMWPMAP* | TS-252G |
WordPerfect 5.2 for Windows | CGMWPWA* | TS-252 |
WordPerfect 6.0 for Windows (Beta) | CGMWP6C CGMWP6G CGMWP6M | TS-252O |
WordPerfect 6.0A for Windows | CGMWPGCA | TS-252P |
WordPerfect 6.1 Windows | CGMWPGIL | TS-252S |
WordPerfect 6.0 for UNIX | CGMWPUXL | TS-252U |
WordPerfect Presents for DOS | CGMWPCA* CGMWPGA* CGMWPMA* | TS-252G |
Zenographics Pixie | CGMPIX | TS-252 |
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.