Syntax
MESSAGE { expression | ERROR | ATTENTION } [ expression ]
Parameters
Message can be abbreviated as ME.
Note: On MCP-based systems, no expression can include wide characters.
expression (first)
A text or numeric value to display in reverse video before the text of the message, as an alternative to either "Error" or "Attention". If a numeric value is used, it will be converted to text.
Signed numeric values are left-aligned with leading zeros suppressed. Decimals are displayed, and negative values are followed by a minus sign.
For ispecs, the value of this parameter is limited to a maximum of 16 characters.
For reports, the value of this parameter is not limited, but its combined length with the text of the message is limited to a maximum of 80 characters.
expression (second)
A text or numeric value giving the text of the message. If a numeric value is used, it will be converted to text.
For ispecs, the value of this parameter is limited to a maximum of 50 characters.
For reports, the value of this parameter is not limited, but its combined length with the preceding expression is limited to a maximum of 80 characters.
Due to a COBOL restriction, the double-quote character requires two character positions. Segment attributes can be used to hold messages, which can be stored in multiple languages.
Description
The Message logic command sends a message to the user interface.
If only one message is displayed, it appears on the status line at the bottom of Page 1. If two or more messages are invoked, they appear on Page 2 of the terminal.
Multiple messages are displayed on MCP-based systems in reverse order to which they are coded.
Messages sent from an unattached report are not returned to the user interface.
When processing an OLTP transaction, the Message command is ignored. The built-in segment attribute Glb.Error is set to five asterisks (*****). No other user indication is given.
Note: Messages queued from the Message logic command take priority over any teach screen currently displayed.
Failure behavior
The Message logic command sets the Glb.Error built-in segment attribute to "*****" in ispec methods, but not in report methods.
Restrictions
The following restrictions apply to use of the Message logic command:
It is not available in Main methods of copy ispecs and copy events. The Message logic command sets the Glb.Error built-in segment attribute to "*****" only in the validation phase of the copy cycle. Message logic statements are not executed in the update phase of the copy cycle.
It is ignored when processing an OLTP transaction. The Glb.Error built-in segment attribute is set to "*****", but no other indications are given.
For applications deployed to Windows, only 19 messages can be displayed. When this limit is exceeded, an error message is produced.
Examples
Example 1
In this example, three message lines are displayed if the tested condition is true.
If Total > Debt.CredLimit Message Error "Customer has exceeded credit limit" Message Amount " is the amount outstanding" Message Debt.CredLimit " is the credit limit" EndExit
Example 2
This example shows that a literal message does not have to be supplied with the Message logic command.
AmtChk := " is the current value in Amount" Message Amount AmtChk : Display Amount value and the text in AmtChk.