Printing Files with Carriage Control Symbols on UNIX systems

Introduction

Many programs (VS FORTRAN, Minitab, etc.) produce output files containing ASA "carriage control" characters in column 1 to tell the printer how many lines to advance before printing the next line. The first column is not intended to be printed, but rather to act as printer-control instructions. These characters include the following.


  blank    Advance one line before printing
  0        Advance two lines before printing
  -        Advance three lines before printing
  1        Advance to the first line of the next page
  +        No advance before printing (i.e., overstrike).
With the exception of the "-" carriage control, all of these controls can be recognized on UNIX systems by preprocessing the file by the "asa" program (filter) before printing the file. Before executing the "asa" program, lines having a "-" carriage control must

The following example file (named "output data" on UDelVM, and "output.data" on UNIX systems) illustrates most of the carriage control characters.

    Column          1         2         3         4         
           1234567890123456789012345678901234567890123456789...

            Sample Program Illustrating Carriage Controls
           +_____________________________________________
           0   Output Section 1
           +   ________________
           0  6 7 8 9 10 2 4 5 6 .........
              5 6 8 4 11 3 4 0 0 .........
                        .
                        .
           1   Output Section 2
           +   ________________
           0            .
On UDelVM, you would print this file by typing

  print output data (cc
On UNIX systems, you must first use the "asa" program. If you just use the "qpr" command to print it, the carriage control symbols will be printed instead of being used to control line spacing and paging.


Printing 80-column output (portrait mode) on UNIX systems

Type

  asa output.data | qpr -q smips
This uses "asa" to preprocess the file, "qpr" to print it, and a UNIX pipe "|" to send the asa output to qpr.


Printing 132-column output (landscape mode) on UNIX systems

Type

  asa output.data | enscript -rB -p- -fCourier-Bold8 | qpr -q smips
This uses "asa" to preprocess the file, "enscript" to rotate it and change the font to a smaller font, "qpr" to print it, and UNIX pipes "|" to send the output of asa to enscript and then to qpr.

The document "Implementing Carriage Control Under UNIX" provides further descriptions of coding carriage controls in FORTRAN programs.

    

 ***************************************************************************
 *                                                                         *
 *                     Correspondence to VS FORTRAN                        *
 *                     ============================                        *
 *                                                                         *
 ***************************************************************************
 *                                                                         *
 *            VS FORTRAN                        UNIX                       *
 *            ==========                        ====                       *
 *                                                                         *
 *               Printing a File with Carriage Control Symbols             *
 *               =============================================             *
 *                                                                         *
 *                    80-column files (portrait mode)                      *
 *                                                                         *
 *  print output data a (cc         asa output.dat | qpr -q smips          *
 *                                                                         *
 *                   132-column files (landscape mode)                     *
 *                                                                         *
 *  print output data (land cc    asa output.dat |                         *
 *                                   enscript -rB -p- -fCourier-Bold8 |    *
 *                                       qpr -q smips                      *
 *                                                                         *
 *                                   (This is one long command.)           *    
 *                                                                         *
 *                             See notes above about "-" carriage control. *
 *                                                                         *
 ***************************************************************************

University of Delaware
June 19, 1994