Universal Printing |
Setting the Default Printer |
A default printer is required for Universal Printing. Unless you specify a default printer, SAS uses a predefined default printer that generates output in PostScript Level 1 language with a 12-point Courier font.
On z/OS, output goes by default to a sequential data set called <prefix>.SASPRT.PS where <prefix> is the value of the SYSPREF= SAS option.
Directing Output to a Universal Printer |
If you are using the SAS windowing environment, you can issue the DMPRINT command in many windows, including the Log, Output, and Program Editor windows, to send window contents to the Universal Printing default printer. You can also use the FILENAME statement to associate a fileref with the default printer, using the device type UPRINTER:
filename myuprt uprinter;
Once a fileref is associated with a printer, you can use that fileref in a PROC PRINTTO statement to print the log or procedure output. For example, the following statement directs any subsequent output to the default UPRINTER:
proc printto log=myuprt print=myuprt; run;
The fileref can also be used in other SAS statements that accept filerefs or in any window command or field that accepts filerefs.
Note: The -ovp option (typically used when a PROC routes log output to a universal printer) is incompatible with the UPRINTER driver. Messages are not overprinted.
Use the PRINTERPATH= SAS option to specify the destination printer for SAS print jobs.
PRINTERPATH=('printer-name' fileref)
must be one of the defined printers. Quotation marks are required around the printer name only when it contains blank spaces.
is an optional fileref. If a fileref is specified, it must be defined with a FILENAME statement or external allocation. If a fileref is not specified, output is directed to the destination defined in the printer definition or setup. Parentheses are required only when a fileref is specified.
Note: The PRINTERPATH= option is an important option in batch processing. It causes Universal Print drivers to be used for SAS/GRAPH and ODS PRINTER output whenever it is set.
The font that is included in the definition of the current default printer is the font used to generate output, unless you override it with the SYSPRINTFONT= system option. SYSPRINTFONT= sets the font to use when printing to the current printer or to the printer identified with the optional keywords NAMED or ALL. You can specify SYSPRINTFONT= in your configuration file, at SAS invocation, or in an OPTIONS statement.
The syntax is as follows:
SYSPRINTFONT=(face-name <weight> <style> <character-set> <point-size> <NAMED printer-name | DEFAULT | ALL>) |
See Changing the Default Font for more information.
Setting Up a Universal Printer with PROC PRTDEF |
Printer definitions can be created in batch mode for an individual or for all SAS users at your site using PROC PRTDEF. The system administrator can create printer definitions in the registry and make these printers available to all SAS users at your site by using PROC PRTDEF with the SASHELP option. You can create printer definitions for yourself by using PROC PRTDEF. Printer definitions that you create with PROC PRTDEF, and without the SASHELP option, are stored in the SASUSER registry. The complete syntax of the PROC PRTDEF statement is as follows:
PROC PRTDEF
<DATA=SAS-data-set> <SASHELP><LIST><REPLACE>; |
specifies a SAS data set that contains the printer definition records. The SAS data set is required to have the variables name, model, device, and dest. The variables hostopt, preview, protocol, trantab, lrecl, desc, and viewer are optional. For more information about these variables, see Required Variables and Optional Variables.
specifies the output location where the printer definitions are stored. Use this option to specify whether the printer definitions are available to all users or just the user who is running PROC PRTDEF. Specifying SASHELP makes the definitions available to all users. You must have permission to write to the SASHELP library. Otherwise, the definitions are stored in SASUSER and are available to the users who are using that SASUSER library.
specifies that a list of printers that were created or replaced is written to the log.
specifies that any printer name that already exists is to be modified using the information in the printer definition data record.
The following sections contain information about the printer definition variables in the input data set specified by DATA=.
hostopt |
The host options column is not case-sensitive. Host options are limited to 256 characters. |
preview |
This variable is not used on mainframe platforms. It is used to specify the printer to use for print preview. |
protocol |
This variable specifies the I/O protocol to use when sending output to the printer. On IBM hosts, the protocol describes how to convert the output to a format that can be processed by a protocol converter that connects the mainframe to an ASCII device. See Setting Up Printers in Your Environment for further information about the use of PROTOCOL. |
trantab |
This variable specifies which translate table to use when sending output to the printer. The translate table is needed when an EBCDIC host sends data to an ASCII device. See Setting Up Printers in Your Environment for further information about the use of TRANTAB. |
lrecl |
This variable specifies the buffer size or record length to use when sending output to the printer. |
desc |
This variable specifies the description of the printer. It defaults to the prototype used to create the printer. |
viewer |
This variable is not used on mainframe platforms. It is used to specify the host system command used during print previews. |
Example PROC PRTDEF Jobs in z/OS |
The following SAS program provides an example of how to use PROC PRTDEF in the z/OS operating environment to set up Universal Printing printer definitions.
The following example shows you how to set up various printers. The INPUT statement contains the names of the four required variables. Each data line contains the information that is needed to produce a single printer definition. The DATA= option on the PROC PRTDEF specifies PRINTERS as the input data set that contains the printer attributes. PROC PRTDEF creates the printer definitions for the SAS registry.
Note: You can use an ampersand (&) to specify that two or more blanks separate character values. This feature allows the name and model value to contain blanks.
data printers; dest = " "; device = "PRINTER"; input @1 name $14. @16 model $18. @35 hostopt $24.; datalines; Myprinter PostScript Level 1 SYSOUT=T DEST=printer1 Laserjet PCL 5 Printer SYSOUT=T DEST=printer5 Color LaserJet PostScript Level 2 SYSOUT=T DEST=printer2 ; proc prtdef data=printers; run;
Note: SYSOUT=T indicates a binary queue, which is a queue that has no EBCDIC to ASCII conversion.
The following SAS program provides an example of how to use PROC PRTDEF in the z/OS operating environment to set up a Universal Printing printer definition that generates an e-mail message with a PostScript attachment.
data printers; name='email'; protocol = 'None'; model = 'PostScript Level 2 (color)'; device = 'email'; dest = 'John.Doe@sas.com'; hostopt = "recfm=vb Subject='Weekly Report' ct='application/PostScript' "; run; proc prtdef data=printers replace list; run;
Note: ct is an abbreviation for the MIME keyword content_type.
Setting Up Printers in Your Environment |
The following tables contain information about the required and optional variables that you need to use to create different types of outputs. Use these option values when you define variables for printing to a Universal Printer in a specific operating environment.
|
Print to a PostScript Printer | Generate PostScript Output and Save to a File | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Model |
One of:
|
One of:
|
||||||||||||||||||||||||
Device Type | PRINTER | DISK | ||||||||||||||||||||||||
Destination | not applicable | Userid.sasprt.ps | ||||||||||||||||||||||||
Host Options | sysout=t dest=<printer-address>* | recfm=vb | ||||||||||||||||||||||||
Protocol | ASCII | ASCII | ||||||||||||||||||||||||
Translate Table | NONE | NONE | ||||||||||||||||||||||||
FTP | not applicable | Binary | ||||||||||||||||||||||||
* SYSOUT=T indicates a binary queue, which is a queue that has no EBCDIC to ASCII conversion. <printer-address> is the LAN queue name, such as PRT23LJ5. |
|
Print to a PCL Printer | Generate PCL Output and Save to a File | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Model |
One of:
|
One of:
|
||||||||||||||||
Device Type | PRINTER | DISK | ||||||||||||||||
Destination | not applicable | Userid.sasprt.pcl | ||||||||||||||||
Host Options | sysout=t dest=<printer-address>* | recfm=vb | ||||||||||||||||
Protocol | ASCII | ASCII | ||||||||||||||||
Translate Table | NONE | NONE | ||||||||||||||||
FTP | not applicable | Binary | ||||||||||||||||
* SYSOUT=T indicates a binary queue, which is a queue that has no EBCDIC to ASCII conversion. <printer-address> is the LAN queue name, such as PRT23LJ5. |
|
Generate PDF Output and Save to a File |
---|---|
Model | |
Device Type | DISK |
Destination | Userid.sasprt.pdf |
Host Options | recfm=vb |
Protocol | ASCII |
Translate Table | NONE |
Buffer Size | 255 |
FTP to PC | Binary |
Copyright © 2009 by SAS Institute Inc., Cary, NC, USA. All rights reserved.