PDA

View Full Version : Send Break Message



Guest.Visitor
01-01-1995, 02:00 AM
I have a CL that is submitted to background. I would like to send a message to the user who submitted it if certain conditions are met. I was trying to use the sndbrkmsg command. I receive an error that the *msgq has to be a workstation msgq. How do I accomplish this? What makes the *msgq a workstation message queue?

J.Pluta
05-27-1999, 06:52 PM
<font color=blue>On Thursday, May 27, 1999, 04:18 PM, Jperez wrote: I have a CL that is submitted to background. I would like to send a message to the user who submitted it if certain conditions are met. I was trying to use the sndbrkmsg command. I receive an error that the *msgq has to be a workstation msgq. How do I accomplish this? What makes the *msgq a workstation message queue? </font><hr> When a user signs on, they basically get two message queues. For example, when user PLUTA signs on to device QPADEV0001, he gets two message queues: user message queue PLUTA and workstation message queue QPADEV0001. You can receive messages at either one, but as you've found out, you can only get break messages at a workstation message queue. The only reasonable way I know of to get the name of the workstation that submitted the job is by passing it as a parameter. <a > href="//www.zappie.net/java"><img > src="//www.zappie.net/java/_derived/index.htm_cmp_zero110_vbtn_p.gif" width="140" height="60" border="0" alt="Zappie's Java Home" align="middle"> Zappie!</a> - where the AS/400 speaks Java with an RPG accent

Guest.Visitor
05-28-1999, 06:24 AM
On Thursday, May 27, 1999, 04:18 PM, Jperez wrote: I have a CL that is submitted to background. I would like to send a message to the user who submitted it if certain conditions are met. I was trying to use the sndbrkmsg command. I receive an error that the *msgq has to be a workstation msgq. How do I accomplish this? What makes the *msgq a workstation message queue? You can only get break messages at a workstation message queue (see Joe Pluta's reply). However, there is a system API that lets you send a break message to a user profile. If the user is signed on, the message is sent to the user's workstation message queue. If the user is NOT signed on, the message is sent to the user's user message queue. The API is QEZSNDMG and can be found in the Operational Assistant API manual. Here is a little CL program I wrote to make sure it works. <pre> PGM DCL &MSGTYPE *CHAR 10 VALUE('*INFO') DCL &DELMODE *CHAR 10 VALUE('*BREAK') DCL &MSGTEXT *CHAR 80 VALUE('TEST MESSAGE') DCL &MSGLENG *CHAR 04 VALUE(X'00000050') DCL &USERS *CHAR 10 VALUE('USERID ') DCL &USRCNT *CHAR 04 VALUE(X'00000001') DCL &MSGSENT *CHAR 04 VALUE(X'00000000') DCL &FUNCREQ *CHAR 04 VALUE(X'00000000') DCL &ERROR *CHAR 256 VALUE(X'00000100') DCL &SHOWMSG *CHAR 01 VALUE('N') DCL &REPLYMQ *CHAR 20 DCL &NAMETYPE *CHAR 04 VALUE('*USR') CALL QEZSNDMG PARM(&MSGTYPE &DELMODE &MSGTEXT &MSGLENG + &USERS &USRCNT &MSGSENT &FUNCREQ &ERROR + &SHOWMSG &REPLYMQ &NAMETYPE) ENDPGM </pre> Hope this helps. If you have any questions about it, just holler! Richard

Guest.Visitor
08-02-1999, 07:18 AM
What I do is retreive the submittors message queue using rtvjoba, send a user message there(sometimes to both the workstation and user message queue) , then change the message queue to *break mode. rob