You can also use bldcomms on MVS, for example, with an Openmake build. The MVS version of bldcomms is MDHBLCM.
The following JCL example is for the first <content of message> format:
//STEP100 EXEC PGM=MDHLBLCM,
// PARM=('POSIX(ON)',
// '/monitormessage node port "R=&RC',
// ' I=%DMSTEP. T=%TIMESTAMP."')
//STEPLIB DD DISP=SHR,DSN=MDH.V1010.MDHLLIB
// DD DISP=SHR,DSN=MDH.V1010.MDHLLPA
//SYSPRINT DD SYSOUT=*
The following JCL example is for the second <content of message> format:
//STEP100 EXEC PGM=MDHLBLCM,
// PARM=('POSIX(ON)',
// '/monitormessage %DMPBEMNODE. %DMPBEMPORT. "I=%DMSTEP.',
// ' T=%TIMESTAMP. M=''JMH001W This is a test message''"')
//STEPLIB DD DISP=SHR,DSN=MDH.V1010.MDHLLIB
// DD DISP=SHR,DSN=MDH.V1010.MDHLLPA
In the example above the M= clause has a single quotation mark (') but as it is inside a PARM statement it must have a double quotation mark (''). Note also that the comma (,) after DMSTEP appears in the message to the PBEM but is ignored because the parameter is converted to an integer. So you must ensure that the comma does not occur somewhere where it is not handled.
There is no provision for very long messages.