Ever want to use an existing message in a message file and try to find the message ID based on the message text? Here's how to do it.
Code: Make sure your default outq is not started to a writer.
Issue the following command:
DSPMSGD RANGE(*ALL) MSGF(XXXLIB/XXXMSGF) OUTPUT(*PRINT)
Locate the spool file:
Device or Opt File User Queue 5 QPMSGD
Use the spool file scan function to find text in the message and identify the message ID.