To write to the system (z/OS) log from an IDMS user program using #WTL (assembler) or WRITE LOG (COBOL), it is required to define the message in the message area of the dictionary first. Is there a way to write to the system log without defining the messages in the dictionary?
To write to the system log, use the #WTL macro or WRITE LOG command - and they do require that the message be pre-defined in the dictionary.
If there are many messages to display and it is desirable to not define all of them in the dictionary, just define one message and pass the whole message text as a parameter. The only drawback is that all messages will have the same message id. The message should be defined like this:
ADD MESSAGE DC999888
TEXT LINE 1
DESTINATION IS OPERATOR.
SEVERITY IS 0
MESSAGE IS '&01'.
When specifying the parameter in the program, the first byte is the length of the parameter. User programs can use message ids above DC900000. Alternatively, use a different prefix to the default of 'DC' and then use any message number. For example, define message IM999888 in the dictionary. In the assembler #WTL, code MSGPREF='IM' or in COBOL code MESSAGE PREFIX is 'IM' so that the program will use message id IM999888.