Built-in Functions
You denote a function by a function name, followed by an operand (or two operands) in parentheses. When valid expressions are substituted for the operands, the result itself is an expression that evaluates to a number, string, or date.
The resulting expression assumes the default print format appropriate for that type of expression (number, string, or date), as described in . For example, if you specify the following:
.print uppercase(column1)
The expression, uppercase(column1), evaluates to a string. When printing the string, Report-Writer uses the default format for strings (c0), not the format for the specified column. If you want to print the resulting expression in a format other than the default for number, string, or date, specify the format explicitly in a .print or .format statement; for example:
.print uppercase(column1) (cf30.6)
A faster and more efficient way to unconditionally print the column value in uppercase for all retrieved rows would be:
select uppercase(column1) as column_a
.format column_a (cf30.6)
.print column_a
You can nest functions to any level.
All of the conversion, numeric, string, and date functions are syntactically allowed in the .cleanup, .query, and .setup statements. For all other Report-Writer statements the following table lists the supported functions. To determine if a function is appropriate for use in a particular context within Report-Writer, see its description in the SQL Reference Guide, or if you are using an Enterprise Access product, the OpenSQL Reference Guide.
The following table lists the built-in functions:
Last modified date: 04/03/2024