Chapter Contents |
Previous |
Next |
SAS Companion for the OS/2 Environment |
The SAS System under OS/2 takes advantage of the OS/2 printers. You can manage your output in the same manner as you manage output from other OS/2 applications. You can also take advantage of OS/2 fonts that are supported by your printers. For details about using OS/2 printers, see your OS/2 documentation. Producing Graphics discusses how to route graphics from your SAS session to printers.
Printing from within a SAS Window |
File | Print... |
Note: The Print dialog box that is shown here might
differ from what you see on your system, depending on which version of OS/2
you use to run SAS and on the active SAS window.
The Print dialog box displays the destination printer's name and the type of printer. To change the destination printer, click on [Setup...] and select a new printer from the Print Setup dialog box..
You can perform other printing tasks by combining these methods. For example, you can print the contents of the currently selected window as a bitmap to a printer file by selecting both the Print to File and Print as Bitmap check boxes.
Here is a summary of the choices that are related to SAS that the Print dialog box offers:
Note that you cannot edit the resulting printer file; it is in a format that is readable only by the type of printer that is specified in the Print dialog box. If you want to save the contents of an application window to a text file without printer formatting, use the Save As... item in the File menu.
For more detailed information about the Print dialog box, click on the [Help] button.
Changing the Print Options |
The Print Setup dialog box (shown in The Print Setup Dialog Box) lets you control how the SAS System prints information. For example, you use this dialog window to select the page setup and the font that is used to print.
You can access this dialog box by selecting Print Setup... from the File menu, or by clicking on [Setup...] from the Print dialog box. If you are using an application that does not provide access to the menus, you can type DLGPRTSETUP at a command line.
The SAS System consults these sources for default printer settings (in order of precedence, first to last):
Here is a summary of the information that is presented in the Print Setup dialog box:
When you change the font size, the SAS System recalculates the maximum LINESIZE and PAGESIZE values and displays them on the Print Setup dialog box.
Note: SAS tabular and columnar reports are formatted
in a monospace font. Using a proportionally spaced font might produce improperly
formatted reports.
Also, the Print Setup dialog box contains a graphic that depicts the current page orientation and margin settings.
Note: The margin settings affect printed output only.
To return to the default printer settings,
click on [Default].
To change the printer options using the SAS System Options window, you must know the printer name, the font, and the line and page size that you want to use.
To change the printer settings by using the SAS System Options window, select
Tools | Options | System |
Changing the Page Setup Options |
The Page Setup dialog box (shown in Page Setup Dialog Box) lets you set the margins and orientation for your printed output.
You can access this dialog box by
File | Page Setup |
Tools | Options | System... | Log and procedure output control | ODS printing |
Here is a summary of the information that is presented in the Page Setup dialog box:
Using SAS System Print Forms |
To specify a print form as the current print form, use
the FORMNAME command or specify the FORMS option in your SAS configuration
file or in the SAS System Options window. To learn the name of the current
form, issue the FORMNAME command with no parameters.
To invoke the FORM window, issue the following command:
FSFORMcatalog-name.form-name |
See the SAS System Help for more information about the FSFORM command.
While the majority of the frames in the FORM window are the same across all operating environments, the first frame that you see after issuing the FSFORM command is the Printer Selection frame, which lists the printers that you are able to use under OS/2. Printer Selection Frame shows the default information for this frame. To move from one FORM window frame to the next, use the NEXTSCR and PREVSCR commands. These commands are located under the Tools menu item.
The information in the Printer Selection frame is also site-dependent, so the printer list at your site will be different from the one shown in Printer Selection Frame.
The Printer Selection frame appears only when you create a new print form. After you create a form, it is stored in your user profile catalog or in the catalog that was specified with the FSFORM command (entry type FORM). The next time that you modify this form, the Printer Selection frame is skipped. You cannot return to the Printer Selection frame from the second FORM window frame.
Printing with SAS Commands |
Sending DATA Step Output to a Printer |
filename myfile printer; data _null_; set mydata; file myfile; where city='Cincinnati'; put _all_; run;
In this example, the PRINTER device-type keyword specifies to print the output to the printer that is specified in the SYSPRINT system option. For more information about the SYSPRINT system option, see SYSPRINT.
Sending Printed Output to a File |
You can also route printed output to a file by using the FILENAME statement, which is useful for routing DATA step output. Here is an example:
filename myfile printer altdest='c:\sas\results.dat'; data _null_; set qtr1data; file myfile; where sales ge 1000; put _all_; run;
In this example, the output from the DATA step is routed to a file, yet still contains all the printer control information that is necessary for you to use your printer to produce formatted output.
Another method of sending printed output to a file is to select the Output to file check box in your printer's Properties notebook Output Port page. When you send output to a file, the contents of the file are overwritten if the file already exists. See your OS/2 documentation for more information about changing printer properties.
Printing in Batch Mode |
When you run SAS jobs in batch mode, you do not have access to the Print and Printer Setup dialog boxes, but you can still take advantage of the OS/2 printer. Use the SYSPRINT system option to specify your default printer (and the SYSPRINTFONT system option to specify your printer font, if you want) as described on SYSPRINT. For example, suppose your SAS configuration file contains the following option:
-sysprint "f2hp5"Then, your SAS program might contain the following statements:
filename myfile printer; data _null_; set schools; file myfile; where enrolled le 500; put _all_; run;
When you submit your job, the SAS System uses the SYSPRINT printer specification to spool your output from the DATA step to the OS/2 printer.
Default Printer Details |
The SAS System looks for a default printer as follows (in order of precedence, first to last):
The SYSPRINT system option is defined as the OS/2 default printer during SAS installation.
To see the value of the SYSPRINT system, open the Print Setup dialog box by either
File | Print Setup |
To change the SYSPRINT system option, see Changing the Print Options.
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.