RPGIV @ Work

A unique site for RPG and System i Lovers


Hi, this site will provide all what you need in System i and RPG developments.

My Name is Chamara Withanachchi, System i Expert and RPG Developer. And in the field for last 11 years.

I hope you will find lot of valuable information from this site

Build, Add entries to DATQ Print E-mail
User Rating: / 0
Written by Chamara Withanachchi   

Originally from www.code400.com

     d TimeStamp       s               Z                                                            
     d IsOdate         s               D                                                            
     d Count           s              4  0                                                          
     d Count2          s              4  0                                                          
     d CmdString       s            256                                                             
     d CmdLength       s             15  5                                                          
     d Reply           s              1                                                             
     d Chr26           s             26                                                             
      * The defined fields for the QRCVDTAQ                                                         
     d   DtaqName      s             10A   inz('TEST')                                              
     d   DtaqLib       s             10A   inz('JAMIELIB')                                          
     d   DtaqLen       s              5P 0 inz(1000)                                                
     d   Data          s             40A                                                            
     d   WaitTime      s              5P 0 inz(-1)                                                  
     d   KeyOrder      s              2A                                                            
     d   KeyLen        s              3P 0                                                          
     d   KeyData       s          32766A                                                            
     d   SenderLen     s              3P 0                                                          
     d   SenderInfo    s          32766A                                                            
     d   RmvMsg        s             10A   inz('*YES')                                              
     d   RcvVarSize    s              5P 0                                                          
     d   ErrorCode     s          32766A                                                            
     d   Receiver      s           2322                                                             
     d   ReceiverLen   s              4B 0 inz(2322)                                                
     d   ReceiverFmt   s              8    inz('RDQM0100')                                          
     d   DataQName     s             20    inz('TEST      JAMIELIB')                                
     d   MessageSel    s            272                                                             
     d   MessageSelLn  s              4B 0 inz(32)                                                  
     d   MessageFmt    s              8    inz('RDQS0200')                                          
     d   Error         s              4B 0 inz(0)                                                   
      * constants                                                                                   
     d Q               c                   const('''')                                              
     ** Delete the message queue                                                                    
     c                   eval      cmdstring = 'DLTDTAQ TESTLIB/TEST'                              
     c                   eval      cmdlength = %len(%trim(cmdstring))                               
     c                   call(e)   'QCMDEXC'                                                        
     c                   parm                    cmdstring                                          
     c                   parm                    cmdlength                                          
     ** CRTDTAQ DTAQ(QTEMP/TEST) MAXLEN(1000) SEQ(*KEYED)                                           
     ** KEYLEN(05) SENDERID(*YES)                                                                   
     c                   eval      cmdstring = 'CRTDTAQ DTAQ(TESTLIB/TEST) '  +                    
     c                             'MAXLEN(1000) SENDERID(*YES)'              +                     
     c                             ' TEXT(' + Q + 'test dataq'+ Q + ')'                             
     c                   eval      cmdlength = %len(%trim(cmdstring))                               
     c                   call(e)   'QCMDEXC'                                                        
     c                   parm                    cmdstring                                          
     c                   parm                    cmdlength                                          
     ** Clear data queue                                                                            
     c                   call(e)   'QCLRDTAQ'                                                       
     c                   parm                    DtaqName                                           
     c                   parm                    DtaqLib                                            
     c                   for       Count = 1 to 5                                                   
     c                   eval      Data = 'Test entry' + %char(Count) +                             
     c                                     '-' + %char(%time())                                     
     c                   call(e)   'QSNDDTAQ'                                                       
     c                   parm                    DtaqName                     Data queue name       
     c                   parm                    DtaqLib                      Data queue library    
     c                   parm                    DtaqLen                      Data queue length     
     c                   parm                    Data                         Queued data           
     c                   endfor                                                                     
     c                   eval      *INLR = *on     

User Comments

Please login or register to add comments

<Previous   Next>