ILE COBOL Programmer's Guide

Writing to Printer Files

Before you can write to a printer file, you must first open the file. You use the Format 1 OPEN statement to open a printer file. A printer file must be opened for OUTPUT.

OPEN OUTPUT printer-file-name.

You use the WRITE statement to send output to a printer file. Use the Format 1 WRITE statement when you are writing to a program described printer file. Use the Format 3 WRITE statement when you are writing to an externally described printer file.

When the mnemonic-name associated with the function-name CSP is specified in the ADVANCING phrase of a WRITE statement for a printer file, it has the same effect as specifying ADVANCING 0 LINES. When the mnemonic-name associated with the function-name C01 is specified in the ADVANCING phrase of a WRITE statement for a printer file, it has the same effect as specifying ADVANCING PAGE.

The ADVANCING phrase cannot be specified in WRITE statements for files with an ASSIGN to device type FORMATFILE.

When you have finished using a printer file, you must close it. Use the Format 1 CLOSE statement to close the printer file. Once you close the file, it cannot be processed again until it is opened again.

CLOSE printer-file-name.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]