ERRMSG errcode [,val1[,val2]]
|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.|
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.
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:  End of file.
The following examples return an error message that takes one supplied value:
ERRMSG 40 ERRMSG 40,24 ERRMSG 40,"test1","test2"
 Program '' has not been compiled.  Program '24' has not been compiled.  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"
Errmsg Errmsg24^ Errmsgtest1^test2^
For a list of error codes and corresponding error messages, see Error Messages in the Caché MultiValue Commands Reference.