troubleshooting Question

RPG Subroutine - want to confirm it is fine.

Avatar of Philky101
Philky101 asked on
7 Comments1 Solution630 ViewsLast Modified:
In this subroutine, we want to see which Customer address records, are not in the Order history,
and if not in there, we want to see if not in the Invoice history. In which cases we want to purge this customer. We want to write each record prior to the delete. We do not want to check the same customer twice +. as there are duplicate Customer numbers (entity #). Is this Subroutine have any holes you might notice?

C     CHKORH_SR     BEGSR                                                    
C                   MOVE      'N'           PUGFIL            1              
C     ORHKEY        CHAIN     OEORH4                                          
 * If the order entity is notfound, write the rec into TRCMASAC file          
C                   IF        NOT %FOUND(OEORH4)                              
C                   MOVE      'Y'           PUGFIL                            
C                   endif                                                    
c     pugfil        ifne      'Y'                                            
C     ORHKEY        CHAIN     OEinh4                                          
C                   IF        NOT %FOUND(OEinh4)                              
C                   MOVE      'Y'           PUGFIL                            
C                   ENDIF                                                    
C                   ENDIF                                                    
C                   IF        PUGFIL = 'Y' AND        
C                             ACENT# <> ACENT#_OLD                      
c                   EXSR      CHKCUS_SR                                
c     ACFLAG        IFEQ      'N'                                      
C                   WRITE     TRCMASRR                                  
c                   delete    arcmasrr                                  
 * Check the record does not exist in stock header file                
c     acflag        ifeq      'N'                                      
C                   EXSR      CHKADR_SR                                
c                   ENDIF                                              
C                   ENDIF                                              
C                   ENDIF                                              
C                   MOVE      ACENT#        ACENT#_OLD                  
C                   ENDSR
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 7 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 7 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros