Previous Page | Next Page

Directing SAS Log and SAS Procedure Output

Directing Output to a Printer


Overview of Directing Output to a Printer

Beginning in Release 8.2, SAS supports two printing destinations for directing procedure output on z/OS: Universal Printing and Xprinter (line) printing. A Universal printer is an e-mail message, network printer, or file that exists on a local area network (LAN). Universal Printing is the default printing destination. Xprinter translates to a printer device on an SNA network. The FORM subsystem is one way to direct output that is destined for a line printer.

The printing destination and default printer at a site are typically determined by data center personnel. This section contains instructions for directing procedure output using either of the printing destinations. You can direct SAS output to a printer as follows:

Universal Printing and the FORM subsystem are portable and are documented in the Base SAS section of the SAS Help and in the SAS Language Reference: Dictionary. To help customer sites get started with Universal Printing, some common z/OS printer definitions, sample printer setup programs, and sample print commands are also provided in Universal Printing.


Using the PRINTTO Procedure and Universal Printing


Overview of the PRINTTO Procedure and Universal Printing

You can use the FILENAME statement with the PRINTTO procedure to route your output directly to a printer. Specify a device type of UPRINTER to direct your output to the default Universal Printing 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 UPRINTER;
proc printto print=output;

The Universal Printing default printer is usually determined by your site's data center personnel. You can define your own default printer in the windowing environment by selecting File [arrow] Print Setup or by issuing the DMSETPRINT printer-name command, where printer-name is the name of the printer you want to make the default. You can also define a temporary default printer by specifying the PRINTERPATH= system option. This option is typically used in the batch environment.


Example

Follow these steps to direct output to the default Universal Printing printer:

  1. Identify a print destination:

    filename myprint UPRINTER;

  2. Identify the print destination to SAS:

    proc printto print=myprint; run;

  3. Submit a print procedure:

    proc print data=work.myfile;
    run;

  4. Remove the print destination from SAS:

    proc printto; run;


Using the PRINTTO Procedure and the FORM Subsystem


Overview of the PRINTTO Procedure and the FORM Subsystem

You can use the FILENAME statement or FILENAME function 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. The default system printer is controlled by the FORM subsystem. 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 value is determined by the data center personnel at your site.


Example

Follow these steps to direct output to the system printer:

  1. Identify a print destination:

    filename myprint dest=dest99 sysout=a hold;

  2. Identify the print destination to SAS:

    proc printto; print=myprint; run;

  3. Submit a print procedure:

    proc print data=work.myfile;
    run;

  4. Remove the print destination from SAS:

    proc printto; run;


Using the PRINT Command and Universal Printing


Overview of the PRINT Command and Universal Printing

Use the PRINT command or menu selection to direct the contents of a window to your default printer. This method is the easiest way to print 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 Universal Printing subsystem. The Universal Printing subsystem consists of five windows that are described in detail in the SAS Language Reference: Dictionary.


Selecting a Printer

To direct the contents of a window to a printer that is not your default printer, you can issue a DMSETPRINT printer-name command, where printer-name is the name of the printer that you want to make the default. You can also specify a temporary default printer by using the PRINTERPATH= system option.


Modifying Printer Properties

To use the default printer and change one or more of its parameters, issue the DMPRINT command on the command line of the window whose contents you want to copy. SAS displays the Print window. If the Use Forms window check box is visible, verify that it is not selected. Select Properties and change any of the parameters. Select OK to accept and OK to print. The new definition is saved in your SASUSER file, and it overrides any definition of a printer of the same name in the SASHELP file.


Creating a New Printer Definition

There are several ways to set up a printer using Universal Printing:

Typically, your system administrator sets up the printers. Your system administrator can save printer definitions to SASHELP so that all users have access to them. When you use PROC PRTDEF, you can save the definitions in the SASUSER or SASHELP libraries.


Printing a Graphics Window

When printing a graphics window, you can print to the default printer, to any other Universal Printer, or to a SAS/GRAPH graphics driver. To print from a printer that is not the default, select from the list of available printers. To print with a SAS/GRAPH driver, select the Use SAS/GRAPH Drivers check box in the Print Method group box. The software displays a list of available drivers from which you can select.


Previewing a Print Job

You cannot currently preview a print job on a mainframe.


Using the PRINT Command and the FORM Subsystem


Overview of 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. The default printer -- as well as other aspects of your output such as printer margins, printer control language, and font control information -- is 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 on-site SAS support personnel can give you information about your default form and about any other forms that have been defined at your site.


Specifying a Form

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:

print form=myoutput


Modifying Your Default Form

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:

  1. Enter fsform default from 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.

  2. Select a printer from the Printer Selection frame. When you select a printer, SAS copies the default form for that printer into your SASUSER.PROFILE catalog.

    Note:   Printer information is site-specific; see your system administrator if you need help with selecting a printer.  [cautionend]

  3. Make other changes to the default form, if desired, by changing the information in the other frames of the FORM subsystem. Issue the NEXTSCR command to scroll to the next FORM frame, and issue the PREVSCR command to scroll to the previous frame. The two 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.

  4. Enter the END command to save your changes.


Adding a Form

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:

  1. Enter fsform myoutput from the command line.

  2. Select a printer from the Printer Selection frame.

  3. Use the NEXTSCR and PREVSCR commands to scroll through the other frames of the FORM subsystem. Use these other frames to provide additional information that is associated with the MYOUTPUT form.

  4. Enter the END command to save your changes.


Examples


Using the PRTFILE and PRINT Commands


Overview of 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.

Note:   The PRTFILE command does not apply to Universal Printing printers. Default values of system-defined printers in the Universal Printing subsystem can be overridden in the Properties window. The modified printer definition is saved to the SASUSER file, which overrides any definition of a printer of the same name in the SASHELP file.  [cautionend]

PRTFILE establishes the destination, and PRINT sends the contents of the window to that destination. If you do not 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 these steps:

  1. From the Program Editor window, submit a FILENAME statement or FILENAME function to allocate a destination file for the output. You can use the DEST= and SYSOUT= options to specify the destination and SYSOUT class, respectively. You can also direct the output to the HOLD queue by specifying the HOLD option. (See SYSOUT Data Set Options for the FILENAME Statement for information about other options that you can specify.)

    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.  [cautionend]

  2. From a command line, issue the PRTFILE command, specifying the fileref from your FILENAME statement or FILENAME function.

    prtfile myrpt

  3. From the command line of the window whose contents you want to print, issue the PRINT command.

  4. If you want to print the contents of any other windows, issue the PRINT command from the command line of those windows. A dialog box warns you that the destination file already exists. Enter A in the dialog box to append the window contents to the destination file.

  5. From the command line of the first window that you printed, issue the FREE command.

  6. From the PROGRAM EDITOR window, submit a FILENAME statement or FILENAME function to clear (deassign) the fileref. Your output is not actually printed until you perform this step.

    filename myrpt clear;


Example

Follow these steps to print a file with PRTFILE and PRINT:

  1. Establish a print destination with the FILENAME statement:

    filename myprint dest=dest99 sysout=a;

  2. Identify the fileref as a print destination:

    prtfile myprint replace

  3. Print the file with the PRINT command or menu selection.

When directing output to a print device, for immediate printing use the FREE command or menu selection, and then 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 When Using Universal Printing

The NOUNIVERSALPRINT system option is related to the printing of SAS output when using Universal Printing. NOUNIVERSALPRINT turns Universal Printing off.


SAS System Options That Relate to Printing When Using the FORM Subsystem

The following system options relate to the printing of SAS output when using the FORM subsystem:

Previous Page | Next Page | Top of Page