LOGMSG

LOGMSG

Top  Previous  Next

 

The LOGMSG statement adds a line to the system error log.

 

 

Format

 

LOGMSG text

 

where

 

textis the message to be logged.

 

 

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.

 

 

Example

 

READ ORDER.NO FROM @VOC, 'NEXT.ORDER' ELSE

  LOGMSG 'NEXT.ORDER record not found'

  RETURN

END

 

The above program fragment logs a message in the system error log if the NEXT.ORDER record cannot be found in the VOC

 

 

See also:

LOGMSG command