The LOGMSG statement adds a line to the system error log.
QM includes the option to maintain a log of system error messages in a file named errlog in the QMSYS account. The LOGMSG statement can be used by application software to write messages into this file. If the error log is disabled by setting the ERRLOG configuration parameter to zero, the LOGMSG statement will be ignored.
Although programs can write to this file using the sequential file handling statements, the internal buffering mechanism used by these statements is likely to result in loss of messages. Programs should, therefore, use on the LOGMSG statement to write messages.
READ ORDER.NO FROM @VOC, 'NEXT.ORDER' ELSE
LOGMSG 'NEXT.ORDER record not found'
The above program fragment logs a message in the system error log if the NEXT.ORDER record cannot be found in the VOC