heading statement

The heading statement designates a text string composed of literals and special options to output at the top of each page.


heading str.exp 
heading "{{text} {’options’}...}"


str.exp is any valid literal string, string expression, or variable. A literal string must be enclosed in either double quotation marks or backslashes because heading options must be enclosed within single quotation marks to distinguish them from text. Multiple options can be enclosed in the same set of single quotation marks.

The heading can be changed with a new heading statement, which outputs the revised heading at the beginning of the next page. The first time the heading is activated, it is output directly to the screen.

The page statement is used to force pagination.

The system(4) function maintains line and system(5) maintains page counters while heading and footing are active.

Note: There is a 1400 character limit to heading strings.

Under normal circumstances, a heading statement executed when there is another heading active does not display anything until the next page. However, D3 redisplays the heading immediately if the current page number is 0.

Mixing heading and footing statements with direct cursor addressing commands is not allowed.


In this example, the heading option string is assigned to the variable head and subsequently assigned as the heading.

heading "’lc’page ’pn’ printed at ’tlc’ this end into shredder first.’l’" 
head = \’c’this is a heading’l’\
heading head