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 last published in May 2001

Dig Deeper on RPG iSeries programming

Start the conversation

Send me notifications when other members comment.

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

Please create a username to comment.

-ADS BY GOOGLE

SearchEnterpriseLinux

SearchDataCenter

Close