Chapter Contents

Previous

Next
SAS Companion for the CMS Environment

Routing Output to a Printer


Using the PRINT Command and the FORM Subsystem

Use the PRINT command to route 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--is controlled by the FORM subsystem. The FORM subsystem consists of six frames that are used 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 SAS Support Consultant can give you information about your default form and about any other forms that have been defined at your site.

The following sections describe how to modify your default printer form.

Specifying a Form

To route 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, type the following on the command line:

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. Type cat sasuser.profile on the command line to display the CATALOG window.

  2. Make sure that you have an entry called DEFAULT.FORM in your SASUSER.PROFILE library. If you do not have a default form, make a copy of your site's default form by typing the following command on a single line:
    copyitem sashelp.base.default.form sasuser.profile.default.form

  3. Type fsforms sasuser.profile.default on the command line to display your default form.

  4. Change the default form by typing over the information in the six 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. Two of these frames, the Print File Parameters frames, are used to specify host-specific printer information; they are described in Host-Specific Frames of the FORM Subsystem. Be sure to change the FORM name in the Print File Parameters frame. Under CMS, SAS recognizes changes only when you change the form name.

    Note:   Many of the values for the FORM parameters are unique to your site. See your system administrator if you need assistance.  [cautionend]

  5. Type the END command to save your changes.


Adding a Form

You can add additional printer 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. Type fsforms myoutput on the command line or select the following from the File pull-down menu:

    Print
    [arrow]
    Utilities
    [arrow]
    Set Up Form Name
    .

  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 will be associated with the MYOUTPUT form.

  4. Type the END command to save your changes.


Using the PRINTTO Procedure

You can use the FILENAME statement in conjunction with the PRINTTO procedure to route your output directly to a printer. Use a device type of PRINTER in the FILENAME statement to assign a fileref 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 reroute the procedure output:

filename outlist printer;
proc printto print=outlist;
run;


Using the PRTFILE and PRINT Commands

You can also use the PRTFILE command, followed by the PRINT command, to print the contents of SAS windows. 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.)

Follow these steps to print the contents of one or more windows:

  1. From the Program Editor window, submit a FILENAME statement to allocate a destination file for the output.

  2. From the command line of any window, issue the PRTFILE command, and specify the fileref from your FILENAME statement:
    prtfile <fileref>

  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 requestor window warns you that the destination file already exists. Type A in the requestor window 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. Your output is not actually printed until you perform this step.

  6. From the Program Editor window, submit a FILENAME statement as follows to clear (deassign) the fileref. For example:
    filename myrpt clear;


Chapter Contents

Previous

Next

Top of Page

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