消息子文件未显示

时间:2017-01-08 13:16:20

标签: ibm-midrange

我编写了一个使用消息子文件的简单程序。但是消息没有显示。你能看一下代码和帮助吗?

DDS:

        A                                      DSPSIZ(24 80 *DS3)                       
        A                                      CA03(03)                                 
        A                                      CA12(12)                                 
        A                                      INDARA                                   
        A* ===========================================================                  
        A          R SCREEN1                                                            
        A                                  1 73DATE                                     
        A                                      EDTCDE(Y)                                
        A                                  2 73TIME                                     
        A                                  1  5USER                                     
        A                                  1 29'Message SubFile Example'                
        A                                      COLOR(WHT)                               
        A                                  5  6'Type a first Name and a last Name -     
        A                                      and Press Enter to test'                 
        A                                      COLOR(BLU)                               
        A                                  8  8'Enter First Name..........'             
        A            FIRST_NAME    20A  B  8 35CHECK(LC)                                
        A                                      EDTCDE(Y)                                   
        A                                  2 73TIME                                        
        A                                  1  5USER                                        
        A                                  1 29'Message SubFile Example'                   
        A                                      COLOR(WHT)                                  
        A                                  5  6'Type a first Name and a last Name -        
        A                                      and Press Enter to test'                    
        A                                      COLOR(BLU)                                  
        A                                  8  8'Enter First Name..........'                
        A            FIRST_NAME    20A  B  8 35CHECK(LC)                                   
        A                                 10  8'Enter'                                     
        A                                 10 14'Last'                                      
        A                                 10 19'Name...........'                           
        A            LAST_NAME     20A  B 10 35CHECK(LC)                                   
        A*                                22  3'F3=Exit'                                   
        A*                                     COLOR(BLU)                                  
        A*                                22 13'F12=Cancel'                                
        A*                                     COLOR(BLU)                                  
        A                                  2  5'*sys'                                      
        A* ===========================================================                  
        A          R MSGSBFL                   SFL                        
        A                                      SFLMSGRCD(22)              
        A            MSGKEY                    SFLMSGKEY                  
        A            SDS_PROC                  SFLPGMQ(10)                
        A* ===========================================================                  
        A          R MSGSBCTL                  SFLCTL(MSGSBFL)            
        A                                      SFLSIZ(0002)               
        A                                      SFLPAG(0001)               
        A                                      SFLDSP                     
        A                                      SFLDSPCTL 
        A            SDS_PROC                  SFLPGMQ(10)            

RPG代码:

    FMSGSBFL1  CF   E             WorkStn INDDS(INDDS)                 

    DINDDS            DS                                               
    DEXIT                     3      3N                                
    DCANCEL                  12     12N                                

    DPSDS            SDS                                               
    D SDS_PROC                1     10                                 

    DMsgId            S              7A                                
    DMsgLoc           S             20A   Inz('SFLMSGF   *LIBL     ')  
    DMsgRplDta        S              1A   Inz(' ')                     
    DMsgRplDtaLen     S              4B 0 Inz(0)                       
    DMsgType          S             10A   Inz('*DIAG')                 
    DMsgQueue         S            276A   Inz('*')                     
    DMsgCallStack     S              4B 0 Inz(0)                       
    DMsgKey           S              4A   Inz(' ')                     
    DMsgErr           S              4B 0 Inz(0)                       
    DMsgrmv           S             10A   INZ('*ALL')                  
    DMsgId            S              7A                                  
    DMsgLoc           S             20A   Inz('SFLMSGF   *LIBL     ')    
    DMsgRplDta        S              1A   Inz(' ')                       
    DMsgRplDtaLen     S              4B 0 Inz(0)                         
    DMsgType          S             10A   Inz('*DIAG')                   
    DMsgQueue         S            276A   Inz('*')                       
    DMsgCallStack     S              4B 0 Inz(0)                         
    DMsgKey           S              4A   Inz(' ')                       
    DMsgErr           S              4B 0 Inz(0)                         
    DMsgrmv           S             10A   INZ('*ALL')                    


     /Free                                                        

       DoU Exit or Cancel;                                        

         Write Msgsbctl;                                          
         Exfmt Screen1;                                           
         MsgKey = *Blanks;                                        
         Exsr RcvMsg;                                             

         If First_Name <> 'Thejwal';                              
           MsgId = 'SFL0001';                                     
           Exsr SndMsg;                                           
         EndIf;                                                   

         If Last_Name <> 'Pavithran';                             
           MsgId = 'SFL0002';                                     
           Exsr SndMsg;                                           
         EndIf;                                                   



       EndDo;                                                   

       *Inlr = *on;                                             

    C     SndMsg        Begsr                                 
    C                   CALL      'QMHSNDPM'                  
    C                   PARM                    MsgId         
    C                   PARM                    MsgLoc        
    C                   PARM                    MsgRplDta     
    C                   PARM                    MsgRplDtaLen  
    C                   PARM                    MsgType       
    C                   PARM                    MsgQueue      
    C                   PARM                    MsgCallStack  
    C                   PARM                    MsgKey        
    C                   PARM                    MsgErr        
    C                   Endsr                                 

    C     RcvMsg        Begsr                                  
    C                   CALL      'QMHRMVPM'                   
    C                   PARM                    MsgQueue       
    C                   PARM                    MsgCallStack   
    C                   PARM                    MsgKey         
    C                   PARM                    MsgRmv         
    C                   PARM                    MsgErr         
    C                   Endsr                                  

我可以看到消息显示在作业日志中但由于某种原因它没有显示在屏幕上。我不确定DDS是否有问题,或者消息是否未发送到正确的程序队列。请帮忙

1 个答案:

答案 0 :(得分:0)

我得到了答案!问题是我错过了Screen1记录格式的overlay关键字。真是一种解脱:)