Don't use SNDBRKMSG. Instead, wrap the QEZSNDMG API in a CL and use that, since it allows you to send to a user profile and not just a workstation. Here's my example:
PGM PARM(&MSGTEXT &USERID)
DCL VAR(&MSGTYPE) TYPE(*CHAR) LEN(10) +
VALUE('*INFO')
DCL VAR(&DELMODE) TYPE(*CHAR) LEN(10) +
VALUE('*BREAK')
DCL VAR(&MSGTEXT) TYPE(*CHAR) LEN(256)
DCL VAR(&MSGLENG) TYPE(*CHAR) LEN(04) +
VALUE(X'00000100')
DCL VAR(&USERID) TYPE(*CHAR) LEN(10)
DCL VAR(&USRCNT) TYPE(*CHAR) LEN(04) +
VALUE(X'00000001')
DCL VAR(&MSGSENT) TYPE(*CHAR) LEN(04) +
VALUE(X'00000000')
DCL VAR(&FUNCREQ) TYPE(*CHAR) LEN(04) +
VALUE(X'00000000')
DCL VAR(&ERROR) TYPE(*CHAR) LEN(256) +
VALUE(X'00000100')
DCL VAR(&SHOWMSG) TYPE(*CHAR) LEN(01) VALUE('N')
DCL VAR(&REPLYMQ) TYPE(*CHAR) LEN(20)
DCL VAR(&NAMETYPE) TYPE(*CHAR) LEN(04) +
VALUE('*USR')
CALL PGM(QSYS/QEZSNDMG) PARM(&MSGTYPE &DELMODE +
&MSGTEXT &MSGLENG &USERID &USRCNT +
&MSGSENT &FUNCREQ &ERROR &SHOWMSG +
&REPLYMQ &NAMETYPE)
ENDPGM: ENDPGM
Then, just call this CL from your programs or whatever and provide it with the message you want to send as well as the user. Unfortunately, you'll have to iterate through calling it again and again if you want to send it to multiple users.
--HTH, Koohiisan.
---------------------
If you have TATOOLs.
Snd Brk Msg to Active WS - TAA (SNDBRKACT) will do what you want.
MAKE IT SIMPLE USE THE KISS RULE. ON A COMMAND LINE KEY IN 'GO MESSAGE' IT WILL BRING YOU TO A MESSAGE SCREEN THAT YOU CAN CHOOSE WHAT TYPE OF MESSAGE YOU WANT TO SEND. PICK THE TYPE YOU WANT TO SEND PRESS ENTER. IT WILL BRING YOU TO A SCREEN WERE YOU CAN ENTER YOUR TEXT FOR YOUR MESSAGE. THEN BELOW THAT YOU CAN CHOOSE *ALLWS WHICH MEANS TO ALL WORKSTATIONS OR YOU CAN PUT IN A LIST OF THE DIFFERENT WORKSTATIONS.
Last Wiki Answer Submitted: January 23, 2009 5:00 pm by Koohiisan4,990 pts.
All Answer Wiki Contributors: Koohiisan4,990 pts. ,
philpl1jb44,180 pts.
If you live outside the United States, by submitting your email address you consent to having your personal data transferred to and processed in the United States.
Alternatively, you could write a CL program that would create an output file of all the active users to whom you want to send a break message, and would then loop through the file to send each of those users the message.
Alternatively, you could write a CL program that would create an output file of all the active users to whom you want to send a break message, and would then loop through the file to send each of those users the message.