|SAS Companion for the OS/390 Environment|
You can direct SAS output to a printer with the PRINTTO procedure, the PRINT command or PMENU selection combined with the FORM subsystem, or with the PRTFILE command combined with the PRINT command or menu selection.
|Using the PRINTTO Procedure|
You can use the FILENAME statement or FILENAME function in conjunction with the PRINTTO procedure to route your output directly to a printer. Use the SYSOUT= option in the FILENAME statement or function to direct your output to the system printer. Then specify the fileref with the PRINT= or LOG= option in the PROC PRINTTO statement. The following example establishes a fileref and uses it in the PROC PRINTTO statement to redirect the procedure output:
filename output sysout=a; proc printto print=output;
Usually, SYSOUT=A specifies that the destination is
a printer; however, this is determined by the data center personnel at your
Follow these steps to print a file with the PRINTTO procedure:
filename myprint dest=dest99 sysout=a hold;
proc printto log=myprint;
proc printto log=log;
|Using the PRINT Command and the FORM Subsystem|
Use the PRINT command or menu selection to direct the contents of a window to your default printer. This is the easiest method of printing output. For example, issue the PRINT command from the command line of your OUTPUT window to send the contents of that window to your default printer.
The default printer--as well as other aspects of
your output such as printer margins, printer control language, and font control
information--are controlled by the FORM subsystem. The FORM subsystem
consists of six frames that are described in detail in
SAS Language Reference: Dictionary and in Host-Specific Windows of the FORM Subsystem.
You use these frames to define a form for each printer that is available to
you at your site. You can also define multiple forms for the same printer.
(See Adding a Form.)
Your local SAS Support Consultant can give you information about your default
form and about any other forms that have been defined at your site.
To direct the contents of a window to a printer that is not your default printer, you can use the FORM= option with the PRINT command. Use this option to specify a form that has been defined for a different printer. For example, to copy output to a printer destination that is described in a form named MYOUTPUT, you would enter the following command-line command:
To change the default destination printer and to customize other features of the output that the PRINT command generates, you can modify the default form that the FORM subsystem uses. To modify your default form, do the following:
fsforms defaultfrom the command line to display your default form. If your SASUSER.PROFILE catalog contains a form named DEFAULT, then that form is displayed. If you do not have a form named DEFAULT, then the Printer Selection frame is displayed.
Note: Printer information
is site-specific; see your system administrator if you need help with selecting
NEXTSCRcommand to scroll to the next FORM frame, and issue the
PREVSCRcommand to scroll to the previous frame. Two of these frames, the Print File Parameters frames, are used to specify host-specific printer information; they are described in Host-Specific Windows of the FORM Subsystem. The other frames are described in SAS Language Reference: Dictionary.
ENDcommand to save your changes.
You can also add additional forms to the FORM subsystem. These forms can then be used with the PRINT command, as described in Specifying a Form, and they can be modified in the same manner as described in Modifying Your Default Form. For example, to create a form named MYOUTPUT, do the following:
fsforms myoutputfrom the command line.
PREVSCRcommands to scroll through the other frames of the FORM subsystem. Use these other frames to provide additional information that will be associated with the MYOUTPUT form.
ENDcommand to save your changes.
To print a file, use the following commands or their respective menu selections:
|Using the PRTFILE and PRINT Commands|
You can also use the PRTFILE command, followed by the PRINT command, to print the contents of windows. This method enables you to override some of the defaults that are established by the FORM subsystem, such as the destination or the SYSOUT class.
PRTFILE establishes the destination, and PRINT sends the contents of the window to that destination. If you don't specify a destination with the PRTFILE command, PRINT automatically sends the window contents to your default printer. (See Using the PRINT Command and the FORM Subsystem for details about using the PRINT command alone.)
For example, to print the contents of your OUTPUT window on RMT5 instead of on your default printer, follow this procedure:
filename myrpt dest=rmt5 sysout=a hold;
Note: The destination printer that you specify
in the FILENAME statement or FILENAME function must be the same type of printer
as your default printer.
Ain the requestor window to append the window contents to the destination file.
filename myrpt clear;
Follow these steps to use SAS commands to print a file with PRTFILE and PRINT:
filename myprint dest=dest99 sysout=a;
prtfile myprint replace
When directing output to a print device, for immediate printing use the FREE command or menu selection, and submit:
filename myprint clear;For delayed printing, ending the SAS session or process forces printing to an output device.
|SAS System Options that Relate to Printing|
The following system options relate to the printing of SAS output:
A valid sysout-class is a single character (number or letter only). Valid classes are site dependent. At some sites, data center personnel may have set up a default class that cannot be overridden.
Top of Page
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.