Question : Sending 'Test' Messages

I am creating a monitoring utilty that watches my QYSOPR and QSYSMSG message queue.  I was wondering if there was a way to send a test message to the QSYSMSG queue to verify if my program is working.  One of the CPF* ID's that I am watching for is CPF0907 (Disk is filling up).  I want to send a CPF0907 to the QSYSMSG message queue to see if my program will "catch" it.

I appreciate any help.

Answer : Sending 'Test' Messages

A CL program can run SNDPGMMSG to send any message ID from any message file to an external message queue.

SNDPGMMSG MSGID( CPF0907 ) MSGF( QSYS/QCPFMSG ) TOMSGQ( QSYS/QSYSMSG ) ...

Beyond the basic parameters, you might need to specify MSGDTA( &somedata ) and populate the &somedata variable to match the substitution fields the are defined for the message ID. You can often leave MSGDTA() alone and live with the strange messages that result.

Tom
Random Solutions  
 
programming4us programming4us