CL Command Reference - PRTDOC

CL Command List > PRTDOC Reference

Description:

The Print Document (PRTDOC) command permits the user to print a document using the word processing function of OfficeVision.

This command also permits the user to override all print option values that are currently stored with a document. When a document is created, a set of default print options is associated with that document. If the user wants to override one or more of the parameters in this print command, the user must select OPTIONS(*YES) so that the print options appear on the display. When the print options appear, any of the print parameters can be changed. The user can override one or all of the print option parameters with this command.

Restriction: To use this command, you must be signed on as QPGMR, QSYSOPR, QSRV, or QSRVBAS, or have *ALLOBJ authority.


Examples:

Example 1: Printing to a File

PRTDOC DOC(MYDOC) FLR(MYFLR) OPTIONS(*OUTFILE)
OUTFILE(MYFILE/MYLIB) OUTMBR(MYMBR *REPLACE)
CURSTS(*PRV) NEWSTS(*PRV) OUTDTATYP(*PRV)
PRTERRLOG(*PRV) DLTDOC(*NO)

This command prints the document MYDOC in folder MYFLR to the database file MYFILE in library MYLIB in the database file member MYMBR. If the member already exists, it is replaced by the contents of MYDOC. The CURSTS, NEWSTS, OUTDTATYP, and PRTERRLOG are taken from the last PRTDOC request. The document is not deleted after it is printed to the database file MYFILE.



Example 2: Printing a Document

PRTDOC DOC(MYDOC) FLR(MYFLR) OPTIONS(*NO)
DEV(MYPRNTR) OUTQ(*DEV)

This command prints the document MYDOC in the folder MYFLR on a printer called MYPRNTR.



Example 3: Printing Document Error Log

PRTDOC DOC(MYDOC) FLR(MYFLR) OPTIONS(*NO) PRTERRLOG(*YES)

This command prints the document with a document error log attached to it.



Example 4: Increasing Margin

PRTDOC DOC(MYDOC) FLR(MYFLR) OPTIONS(*NO) LEFTSPACES(10)

This command prints the document and has 10 extra spaces inserted in the left margin.



Example 5: Printing a Cover Page

PRTDOC DOC(MYDOC) FLR(MYFLR) OPTIONS(*NO) COVERPAGE(*YES)

This command prints the document with a cover page.



Example 6: Printing One Page to a File

PRTDOC DOC(MYDOC) FLR(MYFLR) OPTIONS(*OUTFILE)
OUTFILE(MYLIB/MYFILE) OUTMBR(*FIRST)
PAGERANGE((5 5))

This command prints page 5 of the document to the database file MYFILE in library MYLIB in the first member.