.Nullstring Statement--Specify String for Null Value
The .nullstring statement specifies an alternate null string.
This statement has the following format:
.nullstring | .nullstr 'null_string' | expression
The parameters for the .nullstring statement are as follows:
null_string
Any string of characters. Enclose the string in single quotes, so Report-Writer can properly handle leading and trailing blanks, which are important in some format specifications.
expression
A string expression that evaluates to any character string. Precede all variables that are part of the expression with a dollar sign ($). For more information, see the chapter “Report-Writer Expressions and Formats.”
Description
The .nullstring statement allows you to specify a string to print whenever a null value is to appear on the report. The string can be an expression that evaluates to a string at runtime. Because a data value of null means that there is really no data present to print, you can use the .nullstring to print a designated string that signifies the absence of the data.
Note: Ensure that the length of the null_string is less than or equal to the width of printed nullable columns. If a column is not wide enough to contain the null_string, then the empty string is printed instead.
If you do not specify a .nullstring statement, Report-Writer uses the default value of the II_NULL_STRING environment variable/logical, if defined. If not defined, it uses a default of the empty string (a string with no characters) to print a null value. You can specify several .nullstring statements in a report specification. The system uses the current .nullstring until another .nullstring statement is executed.
Example
Suppose phone_number is a nullable integer column whose value is null. If you issued the following print statements:
.nullstring 'N/A'
.print ' Phone number = ', phone_number .nl
.nullstr '?'
.print 'Phone number = ', phone_number .nl
Report-Writer would print the following if the value of phone‑number were null:
Phone number = N/A
Phone number = ?
Last modified date: 08/14/2024