Ü  DSPLY (Display Function)

 

·         This op-code is used for communication between display work station and the requesting program.

·         Factor-1 (Message) can be a field name, a literal, a named constant, a data structure, a data structure subfield or an array element.

·         The display message can be of maximum length 52 byte.

·         Factor-2 can be a user defined output queue name, QSYSOPR or *EXT. By default the factor-2 value is *EXT, that’s why the message is sent to the external message queue.

·         On the basis of the operation performed in the program the justification on the display screen will be done. E.g. for INZ, EVAL, MOVEL, MOVE, MOVER, MOVE (H) different justification will be done based on these op-codes.

·         If there is any unhandled exception in the program then the display screen appears with the inquiry message and the available options.

 

Factor 1

Op-code

Factor 2

Result Field

Resulting Indicators

       HI                            LO                      EQ

Message to be displayed on screen

DSPLY(E)

Output-queue name

Response for the message

 

Error

 

 


Example

 


Columns . . . :    6  80                   Browse                            AMINEM/QRPGLESRC
SEU==>                                                                               OP_DSPLY
FMT D  DName+++++++++++ETDsFrom+++To/L+++IDc.Keywords+++++++++++++++++++++++++++++
*************** Beginning of data ****************************************************
0001.00 DA                S              2P 0 INZ(25)                                   130128
0002.00 DB                S              2P 0 INZ(11)                                   130128
0003.00  *                                                                              130128
0004.00 C     A             DIV       B             C                 2 0               130128
0005.00 C                   MVR                     D                 2 0               130128
0006.00 C     C             DSPLY                                                       130128
0007.00 C     D             DSPLY                                                       130128
0008.00  *                                                                              130128
0009.00 C                   SETON                                        LR             130128
0010.00                                                                                 130128
****************** End of data *******************************************************

 

 

 

OUTPUT

DSPLY   2 

DSPLY   3

 

 

·         If in our program we are not mentioning any response in result field along with the message in factor-1, then DSPLY opcode only displays the message on the screen and when we press enter the next statement continues execution.

·         If in our program we are mentioning response field along with the message then DSPLY opcode sends an inquiry message which is combination of message and response. Whatever reply we provide to the message is updated in the response field in factor-2.

 


Columns . . . :    6  80                    Browse                           AMITCC/QRPGLESRC
SEU==>                                                                               OP_DSPLY
FMT D  DName+++++++++++ETDsFrom+++To/L+++IDc.Keywords+++++++++++++++++++++++++++++
*************** Beginning of data ****************************************************
0001.00 DA                S              2    INZ('AA')                                 130205
0002.00 DB                S              2  0 INZ(11)                                   130205
0003.00 C     B             DSPLY                   A                                   130205
0004.00 C     A             DSPLY                                                       130205
0005.00 C                   SETON                                        LR             130205
****************** End of data *******************************************************



 

OUTPUT

 

                                                          
                           Display Program Messages                            
                                                                               
                                                                     
 DSPLY  11    AA            >>>>>>>>>>>>>>>> PRESS F1 HERE
                                                                 
 
 

 
             
 Type reply, press Enter.                                                       
   Reply . . . ___________________________________________________
__________________________________________________________________
                                                                                
                                                                               
 F3=Exit   F12=Cancel                                                          

 

 

 

To check what to enter as a reply we press F1 on the inquiry message:

 

 


                         Additional Message Information                        
                                                                               
 Message ID . . . . . . :   RNQ5335       Severity . . . . . . . :   00        
 Message type . . . . . :   Inquiry                                            
 Date sent  . . . . . . :   02/05/13      Time sent  . . . . . . :   07:52:37  
                                                                                
 Message . . . . :   DSPLY  11    AA                                           
 Cause . . . . . :   This is an inquiry message originated from RPG procedure  
   OP_DSPLY in program AMITCC/OP_DSPLY. The program is expecting a character   
   input field with a maximum length of 2.                                     
 Recovery  . . . :   Enter a valid response according to the type of data      
   expected by the program.  The program will tolerate five incorrect responses
   before signalling an error condition.  There have been 0 incorrect responses
   so far.  If you do not want to enter any data, just press Enter to resume   
   processing of the program.                                                   
                                                                               
                                                                               
                                                                                
                                                                         Bottom
 Press Enter to continue.                                                      
                                                                                
 F3=Exit   F6=Print   F9=Display message details                               
 F10=Display messages in job log   F12=Cancel   F21=Select assistance level    

 

 

Here we proceed with no reply, just press ENTER to resume processing of the program and the below content will be displayed on the screen.

 

 


                           Display Program Messages                            
                                                                               
                                                                     
 DSPLY  11    AA                                                               
*N                 >>>>>>>>>>>>>>>>> *N (NO REPLY) is the reply given
 DSPLY  AA                                                                     
                  
 
 

 
                                                            
 Press Enter to continue.                                                       
                                                                               
                                                                               
                                                                               
 F3=Exit   F12=Cancel                                                          

 

 

Run the program again and this time reply with ‘BB’

 

 


                           Display Program Messages                            
                                                                               
                                                                      
 DSPLY  11    AA                                                               
                                                                 
 
 
 
             
 Type reply, press Enter.                                                       
   Reply . . . BB_________________________________________________
__________________________________________________________________
                                                                               
                                                                               
 F3=Exit   F12=Cancel                                                          


 

 

Here the reply ‘BB’ is accepted as a valid reply as the reply should have length of 2 characters (see the F1 message on inquiry message). After this reply the program will continue to the next statement.

 

 


                           Display Program Messages                            
                                                                     
 DSPLY  11    AA                                                               
 BB                                                                             
 DSPLY  BB   
 
 

                                                                 
                                                                               
 Press Enter to continue.                                                      
                                                                               
                                                                               
                                                                                
 F3=Exit   F12=Cancel                  


 

 











User Comments:



Copyright © www.go4as400.com, 2013-2023. Copyright notice   Terms of services   Privacy policy