Problem solve Get help with specific problems with your technologies, process and projects.

Use sign-on display as vehicle for notifying users

Use this program to send a message that appears on a terminal's sign-on screen.


Tim Granatir

Did you ever want to send a message to a terminal that was sitting on a sign-on display? Maybe it's a message to the system console, maybe it's to tell users that they can sign back on after an end-of-month job has completed, or maybe it's just to wish your co-worker a happy birthday. Here is how you can do it.

This program was designed to be submitted to batch with you passing it a device name and your message. These parameters can be fed to it manually or as the result of another job feeding it a list of device names and your message. It will display your message for either an hour or when the user hits enter, whichever comes first.

Although this particular program has a somewhat narrow scope of purposes, I nevertheless have always found this technique to be interesting. The portion of the technique where the sending and the receiving portion of the screens are separated and program processing takes over after a specified period of time is useful in other situations, too.

A                                      DSPSIZ(24 80 *DS3)                  
A          R PMTFMT                                                        
A                                      ALARM                               
A                                      OVERLAY                             
A                                  5  9'**********************************-
A                                      ******************************'     
A                                      DSPATR(HI)                          
A                                  6  9'*'                                 
A                                      DSPATR(HI)                          
A                                  6 72'*'                                 
A                                      DSPATR(HI)                          
A                                  7  9'*'                                 
A                                      DSPATR(HI)                          
A                                  7 72'*'                                 
A                                      DSPATR(HI)                          
A                                  8  9'*'                                 
A                                      DSPATR(HI)                          
A            @MSG          50A  O  8 16DSPATR(HI)                          
A                                  8 72'*'                                 
A                                      DSPATR(HI)                          
A                                  9  9'*'                                 
A                                      DSPATR(HI)                          
A                                  9 72'*' 
A                                      DSPATR(HI)                          
A                                 10  9'*'                                 
A                                      DSPATR(HI)                          
A                                 10 25'Press enter to continue.      '    
A                                      DSPATR(HI)                          
A                                 10 72'*'                                 
A                                      DSPATR(HI)                          
A                                 11  9'*'                                 
A                                      DSPATR(HI)                          
A                                 11 72'*'                                 
A                                      DSPATR(HI)                          
A                                 12  9'*'                                 
A                                      DSPATR(HI)                          
A                                 12 72'*'                                 
A                                      DSPATR(HI)                          
A                                 13  9'**********************************-
A                                      ******************************'     
A                                      DSPATR(HI)                                                           
                                                                                       




 PGM        PARM(&JOB &MSG)                           
             DCLF       FILE(SIGNMSG)                             
             DCL        VAR(&JOB) TYPE(*CHAR) LEN(10)             
             DCL        VAR(&CNT) TYPE(*DEC) LEN(2 0)             
             DCL        VAR(&MSG) TYPE(*CHAR) LEN(50)             
                                                                  
             OVRDSPF    FILE(SIGNMSG) TOFILE(*LIBL/SIGNMSG) +     
                          DEV(&JOB) WAITRCD(60)                   
             CHGVAR     VAR(&@MSG) VALUE(&MSG)                    
                                                                  
 START:      CHGVAR     VAR(&CNT) VALUE(&CNT + 1)                 
             IF         COND(&CNT *GE 60) THEN(GOTO CMDLBL(ENDPGM)
             SNDF       DEV(&JOB) RCDFMT(PMTFMT)                  
             MONMSG     MSGID(CPF0000) EXEC(GOTO CMDLBL(ENDPGM))  
             RCVF       DEV(&JOB) RCDFMT(PMTFMT) WAIT(*NO)        
             MONMSG     MSGID(CPF0000) EXEC(GOTO CMDLBL(ENDPGM))  
             WAIT                                                 
             MONMSG     MSGID(CPF0889) EXEC(GOTO CMDLBL(START))   
ENDPGM:      ENDPGM                                               

---------------------------
About the author: Tim is vice president of Technical Services at Interlink Technologies in Maumee, Ohio, where he serves as chief architect for their warehouse management system. He has worked in the banking, insurance, healthcare and distribution industries in various positions, including programmer/analyst, systems analyst and DP manager. Tim has worked on IBM midrange platforms since 1983.

==================================
MORE INFORMATION
==================================

Dig Deeper on iSeries ILE programming

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchDataCenter

Close