ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Regarding SNDBRKMSG

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Regarding SNDBRKMSG

    Hi All,

    When I try to send message to user profile using SNDBRKMSG, I am getting error . Below is the command and error message.

    SNDBRKMSG MSG('Test') TOMSGQ(PGMSKTOHA)

    Message . . . . : Message not sent. PGMSKTOHA in *LIBL not work station
    message queue.
    Cause . . . . . : Break messages can only be sent to work station message
    queues. The message queue name PGMSKTOHA or the library name *LIBL may not
    be correct.
    Recovery . . . : Correct the message queue name or the library name and try
    the request again.


    What is workstation message queue? How to convert a message queue to work station message? I created a message queue using CRTMSGQ and tried SNDBRKMSG command still I got the same error.

    Please provide me details how to resolve this error

    Thanks
    Srikanth

  • #2
    Re: Regarding SNDBRKMSG

    SNDBRKMSG can only be sent to a message queue that is attached to a workstation!!! so as the message error said either send the message to a workstation message queue or use a different message command!!!
    I'm not anti-social, I just don't like people -Tommy Holden

    Comment


    • #3
      Re: Regarding SNDBRKMSG

      Hi sreekanth1984:

      Check out brkmsg here:


      Best of Luck
      GLS
      The problem with quotes on the internet is that it is hard to verify their authenticity.....Abraham Lincoln

      Comment


      • #4
        Re: Regarding SNDBRKMSG

        I had no idea you could call this in a program, use it all the time interactively.
        Code:
        
        
        /*-------------------------------------------------------------------*/
        /* Program:        BRKMSG                                            */
        /* Description:    Receive two parameters from any program and send  */
        /*                 a message to any User using the QEZSNDMG API from */
        /*                 the Operational Assistant menu.                   */
        /*                                                                   */
        /*                 &MSGTEXT  -  80 character message                 */
        /*                 &USERID   -  10 character UserId to receive msg   */
        /*                                                                   */
        /*                 Notes:  -The message text passed to this program  */
        /*                          should be limited to 80 chars.           */
        /*                         -If the user has multiple sessions open,  */
        /*                          each session will receive a message.     */
        /*                         -Use *ALLACT as USERID to notify everyone */
        /*-------------------------------------------------------------------*/
                     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(80)
                     DCL        VAR(&MSGLENG) TYPE(*CHAR) LEN(04) +
                                  VALUE(X'00000050')
                     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(QEZSNDMG) PARM(&MSGTYPE &DELMODE +
                                  &MSGTEXT &MSGLENG &USERID &USRCNT +
                                  &MSGSENT &FUNCREQ &ERROR &SHOWMSG +
                                  &REPLYMQ &NAMETYPE)
        
        
         ENDJOB:     ENDPGM
        
        
        Thanks to Terry Winchester
        All my answers were extracted from the "Big Dummy's Guide to the As400"
        and I take no responsibility for any of them.

        www.code400.com

        Comment

        Working...
        X