This article clarifies the interpretation of the message-id provided on a WRITE LOG statement.
IDMS dc-cobol programs can issue a WRITE LOG statement which include a message-id which identify the message-code and a severity that will be used if that message is not found on the dictionary. Assembler programs can do the same with the #WTL macro.
Release: All supported releases.
The message-id on the WRITE LOG statement is always interpreted as a seven-digit number. If a message-id is coded with a number that has fewer than seven digits, then the number will be interpreted by the system as a seven-digit number with zeroes padded on the left. The message-code issued will be the first six digits of that seven-digit message-id. The severity used will be the last (seventh) digit. This severity is only used if the message is not found on the dictionary at run time.
For example, if the message-id is 9876543, then that will be interpreted as message-code 987654 with severity 3. If the message-id is 987654, then that will be interpreted as 0987654 so the message-code will be 098765 and the severity 4. If the message-id is 98765, then that will be interpreted as 0098765 so the message-code will be 009876 and the severity 5.
The severity can have serious consequences for the system behaviour, for example, 8 or 9 will abend the CV. All the severities are documented in the WRITE LOG and #WTL links above.
Note: Optional bit 321 changes the behaviour such that severity 0 is always used when the message is not on the dictionary, regardless of what is passed on the WRITE LOG statement.
PTF RO94058 changes the behaviour of bit 321 such that it only changes the severity to 0 if the original severity on the message-id in the statement was 8 or 9.