ASA Carriage Control Characters

The first character in each record (line) of formatted output defines a carriage control character to the lineprinter, often called ASA-character, for a previous name of the US Standardization Organization ANSI. These have the following meanings

        blank     New line

        +         Not new line (overwriting, 

                  not available on all printers)

        0         Double line feed

        1         New page

On some printers additional characters are being used, the digits are often used as vertical tabulators.

NOTE: Output with FORMAT(I5) or F7.3 or 1PE8.2 can cause output of a lot of papers with almost no printing. The reason is many occurrences of the control character "1", each indicating a new page. Therefore it is recommended to give an explicit blank first in all FORMAT:s used for output (if not another control character is being used). The blank character is obtained with 1X or ' ' or the obsolete 1H .

Therefore, never use the same FORMAT for both input and output.

When using VAX/VMS for output first on a file, which is to be printed later on paper, it is advisable to use the extension .DAT. It is only in that case the carriage control characters are being used automatically (by default).

Using UNIX it is more complicated to utilize the control characters, it is being done differently by different manufacturers.

Digital Equipment DEC ULTRIX using Fortran 77

  1. You use the compiler switch -vms
    
        f77     -vms    prog.f
    
    
    and get the control characters removed from the screen output.

  2. You make the output unto a file which has been opened in a special non-standard way
    
        OPEN(1, FILE = 'outfile', CARRIAGECONTROL = 'FORTRAN')
    
    
    and get a file outfile which prints correctly. The command CARRIAGECONTROL is not standard, and will cause compilation error on most other systems.

On Digital Equipment UNIX (Alpha) using Fortran 90

  1. You use the compiler switch -vms
    
        f90     -vms    prog.f90
    
    
    and get the control characters work properly on the screen output.

  2. You make the output unto a file which has been opened in a special non-standard way
    
        OPEN(1, FILE = 'outfile', CARRIAGECONTROL = 'FORTRAN')
    
    
    and get a file outfile which prints correctly. The command CARRIAGECONTROL is not standard, and will cause compilation error on most other systems.

On most systems using either Fortran 77 or 90

  • You compile and run in the usual way, but utilize a special utility to print. This utility is usually called fpr, for example
    
        fpr < outfile | lpr -Pprinter -w132
    
    
    This method works with most manufacturers, some however call fpr for asa. Please give the command man fpr or man asa. The last printer switch above, -w132, gives output in a landscape mode instead of portrait mode, and has nothing to do with control characters. It may be omitted.

  • Locally we now have a problem in Linköping, since all output is performed via PostScript. We therefore recommend you to to use fpr in the following way
    
    	fpr < outfile > output_file2
    
    
    
    	ens output_file2
    
    
    In the dialogue from the utility ens you reply Landscape if you wish to get the output on wide paper.

Last modified: 12 September 1997
boein@nsc.liu.se