Tip

More on sending message to a screen

Here is a quick way which we have used the same method to send informative messages to users who have signed OFF. This is helpful when you have to get users offline do a quick change to the program and then inform them that the option is available for use again.


 		 
Allows for change of message 
(driver cl - executed by a command)
Windowcl
 *************** Beginning of data ************************************* 
 PGM                                                                     
              DCLF       FILE(SYSLIB/WINDOWDF)                           
              RTVDTAARA T1 &HEAD                                         
              RTVDTAARA M1 &DET1                                         
              RTVDTAARA M2 &DET2                                         
              RTVDTAARA SCRTIM &TIM                                      
  RCV:        SNDRCVF       RCDFMT(WINDOWDF)                             
              MONMSG CPF0000 EXEC(GOTO END)                              
              IF         COND(&IN01) THEN(GOTO CMDLBL(END))              
              CHGDTAARA T1 &HEAD                                         
              CHGDTAARA M1 &DET1                                         
              CHGDTAARA M2 &DET2                                         
              CHGDTAARA SCRTIM &TIM                                      
              SBMJOB     JOB(WINDOW) JOBD(QPGMR) JOBQ(QINTER) +          
                           RQSDTA('CALL SYSLIB/WINDOW1CL')               
  END:                                                                   
              ENDPGM                                                     
 ****************** End of data **************************************** 

Window1cl

 *************** Beginning of data **********************************
 PGM                                                                 
              DCLF       FILE(SYSLIB/MSGDEVP)                        
              DSPOBJD    OBJ(QSYS/*ALL) OBJTYPE(*DEVD) +             
                           OUTPUT(*OUTFILE) OUTFILE(SYSLIB/MSGDEVP)  
  RCV:        RCVF       RCDFMT(QLIDOBJD)                            
              MONMSG CPF0000 EXEC(GOTO END)                          
              CALL WINDCL &ODOBNM                                    
              GOTO RCV                                               
  END:        CLRPFM     FILE(SYSLIB/MSGDEVP)                        
              ENDPGM                                                 


Sends the message
 
Windcl 
 *************** Beginning of data ************************************
              PGM        PARM(&VAR)                                    
              DCLF       FILE(SYSLIB/WINDDF)                           
              DCL        VAR(&VAR) TYPE(*CHAR) LEN(10)                 
              DCL        VAR(&TIM) TYPE(*DEC) LEN(3 0)                 
              RTVDTAARA SYSLIB/SCRTIM &TIM                             
              RTVDTAARA T1 &TITLE                                      
              RTVDTAARA M1 &MSG1                                       
              RTVDTAARA M2 &MSG2                                       
              OVRDSPF    FILE(WINDDF) DEV(&VAR) WAITRCD(&TIM)          
              SNDRCVF    DEV(*FILE) RCDFMT(TESTREC1) WAIT(*NO)         
              MONMSG CPF0000 EXEC(GOTO SKIP )                          
              WAIT                                                     
              MONMSG CPF0000                                           
              SNDPGMMSG ('MESSAGE DISPLAYED AT ' || &VAR)               
 SKIP:        ENDPGM                                                   



                 
******************************************
WINDF
 
Actual screen with message which is sent
                                                   
   XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX       
   X                                        X       
   X OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO X       
   X                                        X       
   X This is a message from I.S. (Tel XXXX) X       
   X                                        X       
   X OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO X     

WINDOWDF

Allows for capture of simple message

     Send Message to Signed Off Workstations           
                                                       
                                                       
                                                       
   Heading:  BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB    
                                                       
   Detail1:  BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB    
                                                       
   Detail2:  BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB    
                                                         
   X                                        X       
   X OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO X       
   X                                        X       
   XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX       
                                                    
                                                    
                                                    
 SKIP:        ENDPGM        

   
WINDOWCL
 *************** Beginning of data **********************************
 PGM                                                                 
              DCLF       FILE(SYSLIB/WINDOWDF)                       
              RTVDTAARA T1 &HEAD                                     
              RTVDTAARA M1 &DET1                                     
              RTVDTAARA M2 &DET2                                     
              RTVDTAARA SCRTIM &TIM                                  
  RCV:        SNDRCVF       RCDFMT(WINDOWDF)                         
              MONMSG CPF0000 EXEC(GOTO END)                          
              IF         COND(&IN01) THEN(GOTO CMDLBL(END))          
              CHGDTAARA T1 &HEAD                                     
              CHGDTAARA M1 &DET1                                     
              CHGDTAARA M2 &DET2                                     
              CHGDTAARA SCRTIM &TIM                                  
              SBMJOB     JOB(WINDOW) JOBD(QPGMR) JOBQ(QINTER) +      
                           RQSDTA('CALL SYSLIB/WINDOW1CL')           
  END:                                                               
              ENDPGM                                                 
 ****************** End of data *************************************    

This was first published in May 2001

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.