Creating PCL (Printer Command Language) Files Using Universal Printing

PCL Files in SAS

PCL was developed by Hewlett-Packard (HP) as a language that applications use to control a wide range of printer features across a number of printing devices. PCL files that are created by Universal Printing can be sent to HP LaserJet printers and HP Color LaserJet printers. Universal Printing PCL printers include the PCL4, PCL5, PCL5c, and PCL5e printers:
  • PCL4 produces monochrome output that is to be printed on legacy Hewlett-Packard printers that support the PCL 4 language.
  • PCL5 produces monochrome output that is to be printed on Hewlett-Packard printers that support the PCL 5 language.
  • PCL5c produces color output that is to be printed on Hewlett-Packard printers that support the PCL 5c language.
  • PCL5e produces monochrome output at 600 dpi by default and is to be printed on Hewlett-Packard printers that support the PCL 5e language.
For a description of the PCL printers, you can either view the printers in the SAS registry or submit the following QDEVICE procedure and view the output in the SAS log:
proc qdevice;
printer pcl-printer-name;
run;

Creating a PCL File

You can create a PCL file using the ODS PCL or ODS PRINTER statements. ODS PCL uses the PCL5 universal printer by default. You can specify a different PCL printer by setting a value for PRINTER= in the ODS PCL statement. You specify the pcl-printer universal printer either as the value of the PRINTERPATH= system option or as the value of the PRINTER= option in the ODS PRINTER statement. If you set the PRINTERPATH=pcl-printer system option, you do not need to specify pcl-printer in the ODS PRINTER statement.
Here is some sample code to create a PCL file. The first sample specified does not specify a universal printer in the ODS PCL statement and SAS uses the default PCL5 printer. The second sample specified the PCL5C universal printer as the value of the PRINTER= option in the ODS PCL statement.
  • ods html close;
    ods pcl;
    
    ...more SAS code...
    
    ods pcl close;
    ods html;
  • ods html close;
    ods pcl printer=pcl5c;
    
    ...more SAS code...
    
    ods pcl close;
    ods html;
:
Using the same sample code, you can create a PCL file by substituting ODS PCL with ODS PRINTER:
  • ods html close;
    ods printer printer=pcl5c;
    
    ...more SAS code...
    
    ods printer close;
    ods html;
  • options printerpath=pcl5c;
    ods html close;
    ods printer;
    
    ...more SAS code...
    
    ods printerl close;
    ods html;
SAS creates the file sasprt.pcl in the current directory. PCL files can be viewed after they are created by sending the output to a Hewlett-Packard LaserJet printer or a Hewlett-Packard Color LaserJet printer. PCL files can also be viewed on a monitor with some software applications.