DSPMSG MSGQ(CRITMSG) OUTPUT(*PRTWRAP)
However, user message queues can be easily cleared by users via the F11, F13 and F16 function keys, so the messages you are trying to capture may be deleted before you can capture them with DSPMSG.
You may want to explore writing exit programs for the SNDMSG, SNDBRKMSG, SNDUSRMSG, SNDNETMSG, etc.
The exit program would be executed before the command, allowing you to capture a user's message and send it anywhere you want.
You can find more information on writing exit programs here.
Dig Deeper on Data backup, storage and retrieval on iSeries
Related Q&A from Ken Graap
Find out if log files can be omitted during a save without causing problems in a full restore. Continue Reading
The BRMS Network feature allows a BRMS system to connect to other BRMS systems via a network, and enables a user to consolidate media such as backup ... Continue Reading
The only option to correct damage preventing file journaling is to use the RCLSTG command. Continue Reading