Tip

Prevent irritating SNDBRKMSG messages to *ALLWS

Let's face it; we're all out straight most of the time. There's no need to tear your hair out trying to dodge the break messages that keep interrupting your screen. Here's a way of preventing this long-standing frustration.

The solution, in a nutshell, is to create a Validity Checking program for the SNDBRKMSG command. This program will verify if the message-queue parameter specified has been specified as *ALLWS (while sending a message). If so, it will not allow the message to be sent. Thus, a user can send a break message only to a single workstation at a time. For convenience, a copy of the original command can be maintained in a separate library. This copy, which is allowed *ALLWS parameter, can be used only by the system operator/administrator to broadcast critical messages.


  
Program:  BRKVLDC

/***************************************************************************
**/      
/* SNDBRKMSG HAS 5 PARAMETERS. HENCE 5 DECLARATIONS ARE REQUIRED */

/* Length of all parameters - except T2 (Workstation MSGQ) - is immaterial
*/        
/***************************************************************************
**/      
 

PGM PARM(&T1 &T2 &T3 &T4 &T5)

 

             DCL        VAR(&T1) TYPE(*CHAR) LEN(1)

             DCL        VAR(&T2) TYPE(*CHAR) LEN(20) /* MSGQ + Lib-name */

             DCL        VAR(&T3) TYPE(*CHAR) LEN(1)

             DCL        VAR(&T4) TYPE(*CHAR) LEN(1)

             DCL        VAR(&T5) TYPE(*CHAR) LEN(1)

             DCL        VAR(&T2SUB) TYPE(*CHAR) LEN(10)

 

 

    /* Actual WS-MSGQ name starts from the 3rd char.  */

    /* 1st 2 character contains the number of entries on this parameter */

 

             CHGVAR     VAR(&T2SUB) VALUE(%SST(&T2 3 10))

     /************************************************************/

      /* If entry = *ALLWS, 'Escape' disallow message-sending */

 

              IF         COND(&T2SUB *EQ '*ALLWS') THEN(DO)

              SNDPGMMSG  MSGID(CPF0002) MSGF(QSYS/QCPFMSG) +

                           MSGTYPE(*ESCAPE)

 

         GOTO END

    ENDDO

    /*********************************************************/

 

    END:     ENDPGM

Compile above program. Attach it to SNDBRKMSG command:
CHGCMD CMD(SNDBRKMSG) VLDCKR(MYLIB/BRKVLDC)
  
  

==================================
MORE INFORMATION ON THIS TOPIC
==================================

The Best Web Links: Tips, tutorials and more.

Ask your systems management questions--or help out your peers by answering them--in our live discussion forums.

Read this Search400.com Featured Topic: Managing your iSeries.

Ask the Experts yourself: Our systems management gurus are waiting to answer your technical questions.

This was first published in January 2004

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.