質問: Send a break message to multiple users -------------------------------------- How to send a break message to multiple users.SNBRKMSG has the option to send it only to worksations.
回答: 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.