ERRMSG
Synopsis
ERRMSG errcode [,val1[,val2]]
Arguments
errcode | An expression that resolves to a MultiValue error code; commonly (but not always) specified as a positive integer. The error code can be specified as a literal or as a expression that resolves to a literal value. A non-numeric literal value must be specified as a quoted string. |
val | Optional — A comma-separated list of one or argument values inserted into the error message text. These argument values can be specified as literals or as expressions that resolve to literals. A non-numeric literal value must be specified as a quoted string. |
Description
ERRMSG displays the error message text corresponding to the errcode error code. Error messages are defined in the ERRMSG file. An error message text commonly includes the error code (in square brackets) as part of the message.
If you specify a errcode value that does not correspond to an error code, ERRMSG displays the string “Errmsg” with the error code in square brackets.
If you specify one or more val arguments, ERRMSG displays the errcode error message text with these val arguments inserted in the message. If the errcode error message does not take an inserted value, the val argument is ignored. If the errcode value does not correspond to an error code, ERRMSG returns the “Errmsg” string with val appended and followed by a caret (^) separator character.
Examples
The following examples return an error message that does not take a supplied value:
ERRMSG 94
ERRMSG 94,24
ERRMSG 94,"test1","test2"
all of these return: [94] End of file.
The following examples return an error message that takes one supplied value:
ERRMSG 40
ERRMSG 40,24
ERRMSG 40,"test1","test2"
these return:
[40] Program '' has not been compiled. [40] Program '24' has not been compiled. [40] Program 'test1' has not been compiled.
The following examples specify a num value that does not correspond to an error code:
ERRMSG 50
ERRMSG 50,24
ERRMSG 50,"test1","test2"
these return:
Errmsg[50] Errmsg[50]24^ Errmsg[50]test1^test2^
For a list of error codes and corresponding error messages, see Error Messages in the Caché MultiValue Commands Reference.