This control enables users to specify the footer text string that appears at the bottom of each page of a report.
where the following is true:
- Text for the footer.
The string can contain a maximum of 253 characters, including line separator characters, to describe up to 10 lines.
If no string is specified, the footer is reset to NULL.
The FOOTING command can be used in an SQL macro.
Using Special Characters
Do not use special characters within the string because they might be interpreted differently by different output devices. A modified script that uses special characters might be necessary if the output is routed to another device.
If the string has an apostrophe (single quote) character, use the second form of the FOOTING command (the one with quotes as delimiters) or double the apostrophe. For example:
.SET FOOTING "December's Results"
.SET FOOTING 'December''s Results'
If the string does not have an apostrophe, the two forms of the FOOTING command are equivalent.
Control footing formats using two types of control characters:
|Double slashes (//)||Breaks the line, and begins a new line.|
|Solid vertical bars (||)||Separates the line into sections.|
Breaking a Line
Break a footer line and begin a new line of footer text by inserting a pair of slashes (//) at the desired break point. In BTEQ up to nine line breaks are valid (10 footer lines maximum) within a FOOTING command.
Separating a Line into Sections
Separate a footer line into as many as three sections by inserting a pair of solid vertical lines at the desired separation points. Only three sections are valid (two pairs of vertical bar separators) for each line of the footer.
|A footer with no separator characters||Leaves the line as one section.||The footer is centered.|
|One set of separator characters||Separates the line into two sections.||The first part of the line is left-justified, and the second part of the line is centered.|
|Two sets of separator characters||Separates the line into three sections.||The first part of the line is left-justified, the second part of the line is centered, and the third part of the line is right-justified.|
Exceeding the Line Separator Limit
If more than two pairs of vertical bar separator characters are specified, the following results occur:
|Mainframe-attached||BTEQ interprets the additional characters as footer text, and issues a warning that the limit of two pairs of vertical bar separator characters has been exceeded.|
|Workstation-attached||BTEQ truncates the additional separators from the footer text.|
For example, in a mainframe-attached system the following command creates the warning message and incorrect footing information shown below the example command.
.SET FOOTING '&DATE||Confidential Report||Part Two||Page&PAGE'
*** Warning: Maximum of 2 '||' separators is allowed, others ignored.
90/08/25 Confidential Report Part Two||Page2
Using Substitution Values
As shown in the preceding example, the following substitution values are valid anywhere in a footer string:
|&DATE||Is replaced with the current date in YY/MM/DD format.|
|&TIME||Is replaced with the current time in HH:MM format.|
|&PAGE||Is replaced with the current page number. (If a footer is specified and &PAGE is not specified, the page number does not appear in the footer.)|
|&n||Is replaced with the most recent value in the nth expression of the returned row that immediately precedes the footing. The &n substitution value is not valid in the following cases:
For non-exported output within z/OS BTEQ Unicode sessions, this value must be comprised only of LATIN1 characters.
Specifying a Footer Wider than the Page
If a footer text string is wider than the page width, BTEQ first truncates the middle portion of the footer. If more must be truncated, BTEQ truncates the right and left portions until the footer fits on the page. Truncation is from the right, as shown in the following example:
.set format on .set footing 'This is an example of a footing that is too long for the page and is truncated starting from the right'
Results for a subsequent data-returning SQL request will include the following footer :
This is an example of a footing that is too long for
If a Footer is Not Specified
If a footer is not specified, BTEQ uses the lines of the footer area at the bottom of the page for including additional returned rows.
Example 1 – FOOTING
database workforce; .set defaults on .set format on .set footing 'Confidential Report' select * from department ;
*** Query completed. 5 rows found. 4 columns returned. 90/07/25 select * from department; Page 1 DeptNo DeptName Loc MgrNo ------ -------------- --- ----- 500 Engineering ATL 10012 700 Marketing NYC 10021 300 Exec Office NYC 10018 600 Manufacturing CHI 10007 100 Administration NYC 10011 Confidential Report
Example 2 – FOOTING
database workforce; .set defaults .set format on .footing "This is an example - of a continued footing- with incorrect spacing" select * from department ;
*** Query completed. 5 rows found. 4 columns returned. 90/07/25 select * from department; Page 1 DeptNo DeptName Loc MgrNo ------ -------------- --- ----- 500 Engineering ATL 10012 700 Marketing NYC 10021 300 Exec Office NYC 10018 600 Manufacturing CHI 10007 100 Administration NYC 10011
This is an example of a continued footing with incorrect spacing.
Example 3 – FOOTING
database workforce; .set defaults .set format on .footing '&date||Confidential||Page&Page' select * from department ;
*** Query completed. 5 rows found. 4 columns returned. 90/07/25 select * from department; Page 1 DeptNo DeptName Loc MgrNo ------ -------------- --- ----- 500 Engineering ATL 10012 700 Marketing NYC 10021 300 Exec Office NYC 10018 600 Manufacturing CHI 10007 100 Administration NYC 10011 90/07/25 Confidential Page 1
Example 4 – FOOTING instigated by a macro
The statements in an SQL macro appear as:
ECHO '.SET FOOTING ''&DATE||Confidential||Page&PAGE'' ';
ECHO '.SET FOOTING "&DATE||Confidential||Page&PAGE"';