Controlling the Display of Empty Reports

How to:

Reference:

The SET command, SET EMPTYREPORT, enables you to control the output generated when a TABLE request retrieves zero records.

The EMPTYREPORT=ANSI setting introduces ANSI-compliant handling of reports with zero records, producing a one-line report containing only the specified missing data character. If the request is a COUNT operation, however, a zero is displayed for the missing values.

Syntax: How to Control Empty Reports

Use this command:

SET EMPTYREPORT = {ANSI|ON|OFF}

Valid values are:

ANSI

Produces a single-line report and displays the missing data character or a zero if a COUNT is requested. in each case, &RECORDS will be 0, and &LINES will be 1.

If the SQL Translator is invoked, ANSI automatically replaces OFF as the default setting for EMPTYREPORT.

ON

Generates an empty report when zero records are found.

OFF

Does not generate a report when zero records are found. OFF is the default setting.

The command may also be issued from a request. For example:

ON TABLE SET EMPTYREPORT ON

Example: Controlling the Display of Empty Reports

following request does not retrieve any records and sets the EMPTYREPORT parameter to OFF.

SET EMPTYREPORT=OFF
TABLE FILE WFLITE
HEADING
"This is the heading"
SUM COGS_US REVENUE_US COLUMN-TOTAL ROW-TOTAL
BY COUNTRY_NAME
WHERE COUNTRY_NAME EQ 'Louisiana'
FOOTING
"This is the footing"
ON TABLE SET STYLE *
GRID=OFF,$
END

The following output is produced.

0 NUMBER OF RECORDS IN TABLE=        0  LINES=      0

Changing the EMPTYREPORT setting to ON produces the output shown in the following image.

Changing the EMPTYREPORT setting to ANSI produces the output shown in the following image.

Reference: Usage Notes for Displaying Empty Reports

  • TABLEF is not supported with SET EMPTYREPORT. When a TABLEF request retrieves zero records, EMPTYREPORT behaves as if EMPTYREPORT is set ON.
  • This is a change in default behavior from prior releases of FOCUS. To restore prior default behavior, issue the SET EMPTYREPORT = ON command.
  • SET EMPTYREPORT = OFF is not supported for HOLD FORMAT WP files or styled output formats.
  • SET EMPTYREPORT = ON behaves as described regardless of ONLINE or OFFLINE settings.

Information Builders