HPlogo Task Reference: HP 3000 Series 9X8LX Computer Systems > Chapter 2 Performing Tasks Using MPE/iX Commands

Printing the Contents of a File

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

 » Glossary

 » Index

You can choose various methods to print a file. Word processing programs have specific commands that allow you to specify the file and format of the text. This type of command is unique to the word processing program and is not dealt with here. Refer to the documentation that came with your word processor.

Several methods of displaying or printing the contents of a file are available. The variations include sending output to a printer as well as to a terminal.

To print a file to paper

To print the contents of a file to a printer, use the FILE command to identify the printer.

  1. Create a file equation that correlates a name with the printer's device class or logical device number. Then use the printer reference in the PRINT command.

       :FILE name;DEV=printer Return
    

    In the following example, the name PRTR is equated with the LP device.

       :FILE PRTR;DEV=LP Return
    
  2. Enter the PRINT command. Include in its parameters, the name of the file to be printed, the OUT= parameter, an asterisk, and the name specified in the file equation. In the following example, the OUT= parameter refers back to the previous file equation and designates *PRTR as the output file. Because of the file equation, the * is equivalent to the LP device, namely the printer.

       :PRINT MYFILE;*PRTR Return
    

To print a file and save it as a spool file

  1. To keep a copy of your printed file as a spool file, attach the SPSAVE option on the FILE command:

       :FILE PRTR;DEV=LP;SPSAVE Return
    
  2. Enter the following:

       :PRINT MYFILE;*PRTR Return
    

To print selected lines of the file

To print selected lines of a file to a printer, use the FILE command to identify the printer and the PRINT command to specify the lines of text that you want printed.

  1. Create a file equation that correlates a file name with the printer's device class or logical device number. In the following example, the file name PRTR is equated with the LP device:

       :FILE PRTR;DEV=LP Return
    
  2. Enter the PRINT command. Include the file to be printed, the starting and ending line numbers, the OUT= parameter, an asterisk, and the name specified in the file equation. In the following example, the OUT= parameter refers back to *PRTR as the output file, which in this case is equivalent to the printer:

       :PRINT MYFILE;START=1;END=10;*PRTR Return
    

To print only the end of a file

To print the last lines of a file to a printer, use the FILE command to identify the printer and the PRINT command to specify the portion of the file to print. Use a negative number after the START= parameter of the PRINT command, to specify the starting line number from the end of the file.

  1. Create a file equation that identifies a file name with the printer's device class or logical device number. In the following example, the name PRTR is equated with the LP device:

       :FILE PRTR;DEV=LP Return
    
  2. Enter the PRINT command. Include in its parameters, the name of the file to be printed, the START= starting line number, an asterisk, and the name specified in the file equation.

    In the following example, the last twenty lines of the file MYFILE will be printed to a printer equated in the preceding file equation to PRTR.

       :PRINT MYFILE;START=-20;*PRTR Return
    
Feedback to webmaster