| 
 | 
Just a small comment, how about placing your Return op code, right after you get a match, so your routine doesn't keep reading additional records after a match is found? Or can there only be one matched record?
tim
-----Original Message-----
From:   Jim Langston [SMTP:jimlangston@conexfreight.com]
Sent:   Monday, December 11, 2000 2:15 PM
To:     RPG400-L@midrange.com
Subject:        Re: DoW (WAS DoU...)
This is not a question, but just the result of the questions I was
asking.  I am posting the final code in case anyone lurking was 
interested in how it turned out.  The code was converted to a 
function with prototypes.
Again, thanks for all the help.
Regards,
Jim Langston
  *** Prototype for ContExistRefB Function ***            
 D ContExistRefB   PR             1A                      
 D  CER_Alpha                     4A   Const              
 D  CER_Numeric                   7A   Const              
 D  CER_RefB                           Like(OHRefB) Const 
...
D BillingRef S Like(OHRefB)
...
  *                  *** See if we can find a match in the CCOHD file ***    
 C                   Eval      BillingRef = Bd_RXInv#                        
 C                   Eval      FoundMatch = ContExistRefB(Bd_RXEqId:         
 C                                                    Bd_RXEqNo + Bd_RXCChk: 
 C                                                    BillingRef)            
                                                                             
...
  ********************************************************************************* 
  *** ContExistRefB - Does Container Exist by Billers Reference Number Function *** 
  ********************************************************************************* 
                                                                                    
 P ContExistRefB   B                                                                
                                                                                    
 D ContExistRefB   PI             1A                                                
 D  CER_Alpha                     4A   Const                                        
 D  CER_Numeric                   7A   Const                                        
 D  CER_RefB                           Like(OHRefB) Const                           
                                                                                    
 D FoundMatch      S                   Like(*IN01)                                  
                                                                                    
 C     CCOHD_Key     KList                                                          
 C                   KFld                    CER_Alpha                              
 C                   KFld                    CER_Numeric                            
                                                                                    
 C                   Eval      FoundMatch = *Off                                    
 C     CCOHD_Key     SetLL     OHdRc                                                
 C     CCOHD_Key     Reade     OHdRc                                                
 C                   DoW       Not %Eof(CCOHD04) And                                
 C                             Not FoundMatch                                       
                                                                                    
  *                  *** Container matches, does the Biller's Reference Number? *** 
 C                   If        %Trim(OHRefB) = %Trim(CER_RefB)                      
 C                   Eval      FoundMatch = *On                                     
 C                   Else                                                           
 C     CCOHD_Key     Reade     OHdRc                                                
 C                   EndIf                                                          
                                                                                    
 C                   EndDo                                                          
                                                                                    
 C                   Return    FoundMatch                                           
                                                                                    
 P ContExistRefB   E
+---
| This is the RPG/400 Mailing List!
| To submit a new message, send your mail to RPG400-L@midrange.com.
| To subscribe to this list send email to RPG400-L-SUB@midrange.com.
| To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.