The HEADING statement causes all subsequent output to the terminal to be halted at the end of each page. The statement allows an expression to be evaluated and displayed at the top of each page. If output is currently being sent to the terminal, output is paused until a carriage return is entered at the terminal - unless the N option is specified.



HEADING {ON channel} expression



The expression should evaluate to a string that will be printed at the top of every page of output. The string may contain a number of special characters that are interpreted and replaced in the string before it is printed. The following characters have special meaning within the string:

"B" Insert the break value from a BREAK-ON that also uses the 'B' option.
"C{n}" Center the line. If n is specified the output line is assumed to be n characters long.
"D" or \\ Replace with the current date.
"L" or ] Replace with the newline sequence.
"N" Terminal output does not pause at the end of each page.
"P" or ^ Replace with the current page number.
"PP" or ^^ Replace with the current page number in a field of 4 characters. The field is right justified.
"T" or \ Replace with the current time and date.
" Replace with a single " character.

If ON channel is specified then it is assumed that a PRINTER ON statement is in force and the heading will be sent to the spooler channel number assigned from a SP-ASSIGN statement.



If output is being directed to the printer (a PRINTER ON statement is in force), output sent to the terminal with the CRT statement will not be paged. If output is being sent to the terminal, all output will be paged unless you specify the N option.

The second and subsequent HEADING statements cause a page throw in the output to the terminal or the printer. However if the HEADING expression is preceded by an attribute mark then the page throw does not occur and the new heading is used at the next "natural" page break or PAGE statement. The emulation option 'defer_header_output' can also be used to obtain this behavior without using the attribute mark.

Also see the FOOTING statement.



HEADING "Programming staff by size of waist     Page 'PL'"