L

Produces formatted printer output.

Syntax

L element{,element}...

Syntax Elements

element is text or format print commands, as listed below.

Elements

Elements can be one of the following:

"text" Outputs the specified text. The text must be enclosed in single or double quotes.

n Skips the number of lines specified by n before printing. Element n cannot be used in a HDR format print command.

r{;input;} Prints the value obtained by direct or indirect reference to a buffer or select register specified by r. An optional English input conversion can be applied to the value prior to printing.

r{:output:} Prints the value obtained by a direct or indirect reference to a buffer of select register specified by r. An optional English output conversion can be applied to the value prior to printing (see Conversion Codes).

(c) Sets the current horizontal position to the column number specified by c. The value c can be a direct or indirect reference to a buffer or select register.

+ Inhibits RETURN/LINEFEED output at the end of an L command. + cannot be used in a HDR format print command.

C Closes the print file forcing printing of accumulated output. C cannot be used in a HDR format print command.

E Ejects to top-of-form. E cannot be used in a HDR format print command.

N Forces subsequent printer output to terminal for debugging. If N is used, it must be the only element in the L command.

HDR Generates a page heading. If HDR is used, it must be the first element in an L command.

L Produces a line feed in the heading. The L element is used only with the HDR element.

P Prints the current page number in a heading. The P element is used only with the HDR element.

T Prints current time and date in a heading. The T element is used only with the HDR element.

Z Zeros the current page number in a heading. The Z element is used only with the HDR element.

Operation

If the L command ends with a comma (,), then the command can continue on subsequent lines. The continuation lines do not start with an L.

If the last element in the L command is a +, then no RETURN/LINEFEED is output, and the output from the next L command is appended to the current line.

Page headings can be generated using the HDR element as the first element in an L command (see examples). When a heading statement is executed, any direct or indirect references are evaluated and stored in the heading buffer; therefore, it is not necessary to maintain these values.

Comments

Sending output to the printer via the L command creates a print or hold file if one is not already open and then continues to add to it. However, execution of a command in the primary output or secondary output buffer causes that print or hold file to be closed. Additionally, if the command executed generates its own printer output, this output is added to the print or hold file before it is closed.

To avoid this problem, you need to open a print or hold file indefinitely using the O option of the SP-ASSIGN command. See system documentation on the spooler for more information on SP-ASSIGN.

Another possibility is to simply complete the report being generated using the L command prior to executing TCL commands via the P command.

Example 1

IH12
L HDR,T,(25),"PAGE ",P
L 2,"THE VALUE OF X IS:",%1

This example produces the following output:

14:38:29  12 Feb 1990    PAGE 1
THE VALUE OF X IS:12

Example 2

IH100 200 300 400 500 600
L E
L (4),%1,(8),%2,(12),%3,
(16),"PARMS 1-3"
L (4),%4,(8),%5,(12),%6,
(16),"PARMS 4-6"

This example outputs the following:

100  200  300  PARMS 1-3
400 500 600 PARMS 4-6