140 pts.
 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.

Software/Hardware used:
ASKED: January 23, 2009  10:03 AM
UPDATED: January 23, 2009  5:00 PM

Answer Wiki:
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  Koohiisan   4,990 pts.
All Answer Wiki Contributors:  Koohiisan   4,990 pts. , philpl1jb   44,180 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

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.

 4,275 pts.