Displays the specified column, variable, or literal.
Text, number, or date to display.
Edits the field before displaying it. (see Edit Masks)
Formats any_lit|_var|_col with the NUMBER‑EDIT‑MASK of the current locale. This option is not legal with date variables.
Formats any_lit|_var|_col with the MONEY‑EDIT‑MASK of the current locale. This option is not legal with date variables.
Formats any_lit|_var|_col with the DATE‑EDIT‑MASK of the current locale. This option is not legal with numeric variables. If DATE‑EDIT‑MASK has not been specified, then the date is displayed using the default format for that database (see Table 61, Default Formats by Database).
Suppresses the carriage return after displaying the field.
DISPLAY can display data to a terminal. The data is displayed to the current location on the screen. If you wish to display more than one field on the same line, use NOLINE on each display except the last.
Dates can be contained in a date variable or column, or a string literal, column, or variable. When a date variable or column is displayed without an edit mask, the date appears in the following manner:
For DATETIME columns and Production Reporting DATE variables, Production Reporting uses the format specified by SQR_DB_DATE_FORMAT. If not set, Production Reporting uses the first database-dependent format in Table 61, Default Formats by Database.
For DATE columns, Production Reporting uses the format specified by SQR_DB_DATE_ONLY_FORMAT. If this is not set, Production Reporting uses the format in Table 62, DATE Column Formats.
For TIME columns,Production Reporting uses the format specified by SQR_DB_TIME_ONLY_FORMAT. If not set, Production Reporting uses the format in Table 63, TIME Column Formats.
When displaying a date in a string literal, column, or variable using EDIT or DATE, the string uses the format specified by SQR_DB_DATE_FORMAT, one of the database-dependent formats in Table 61, Default Formats by Database, or the database-independent format SYYYYMMDD[HH24[MI[SS[NNNNNN]]]].
If you require more control over the display, use SHOW.
The following segments illustrate the various features of DISPLAY:
Produces the following output:
123-45-6789
Produces the following output:
1,234,567.89
Produces the following output:
123.780000
! ! Display a number using the locale default numeric edit mask ! alter-locale number-edit-mask = '99,999,999.99' display 123456.78 number
Produces the following output:
123,456.78
! ! Display a number using the locale default money edit mask ! alter-locale money-edit-mask = '$$,$$$,$$9.99' display 123456.78 money
Produces the following output:
$123,456.78
! ! Display a date column using the locale default date edit mask ! begin-select dcol from tables end-select alter-locale date-edit-mask = 'DD-Mon-YYYY' display &dcol date
Produces the following output:
01-Jan-1999
Produces the following output:
Hello World
! ! Display two values on the same line with editing of the values ! alter-locale money-edit-mask = '$$,$$$,$$9.99' let #taxes = 123456.78 display 'You owe ' noline display #taxes money noline display ' in back taxes.'
Produces the following output:
You owe $123,456.78 in back taxes.
SHOW for information on screen control
LET for information on copying, editing, or converting fields
The EDIT parameter of PRINT for edit mask descriptions
ALTER-LOCALE for descriptions of NUMBER-EDIT-MASK, MONEY-EDIT-MASK, and DATE-EDIT-MASK