RPGLE program to check data across 3 file systems

345295 pts.
Tags:
File systems
RPGLE
I'm working on a project with RPGLE wherein we purge customer numbers from our files if there is no data behind the record. This purge will take place across three file systems. Of course, it's not as simple as a yes/no situation. In one of the file systems, we need to verify that there is no invoice history prior to 2009 - the first system starts after that. If there is, then that record needs to be maintained in all three systems.  In the file in question, an A or C means the data is relevant and must be saved. Here is the code I developed, but its not working correctly.  Any thoughts?  
C                   IF        PUGFIL = 'Y' AND        
C                             ACENT# <> ACENT#_OLD    
c                   EXSR      CHKCUS_SR               
c     ACFLAG        IFEQ      'N'                     
C                   WRITE     TRCMASRR                
c*                  delete    arcmasrr               

c     CHKCUS_SR     BEGSR      
c                   eval      ACFLAG = ' '                        
C     ORHKEY        SETLL     dRCST1                              
C     ORHKEY        READE     dRCST1                              
 * If the order entity is found, write the rec into VRCSTKBI file 
C                   DOW       NOT %EOF(dRCST1)                    
c                   if        BICOTC <> 'A' AND BICOTC <> 'C'     
C                   WRITE     VRCSTKRR                            
c                   EVAL      ACFLAG = 'N'                        
c                   endif                                         
c                   if        bicotc = 'A'                        
c                   if        BISTPD <  20070101                  
C                   WRITE     VRCSTKRR                            
c                   EVAL      ACFLAG = 'N'                        
c                   endif                                         
c                   endif                                         
c                   if        bicotc = 'C'                        
c                   if        BISTPD <  20070101                  
C                   WRITE     VRCSTKRR                            
c                   EVAL      ACFLAG = 'N'         
c                   endif                          
c                   endif                          
c     acflag        ifeq      'N'                  
C                   EXSR      CHKADR_SR            

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Discuss This Question: 2  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • CharlieBrowne

    First, what do you mean it is not working correctly? Can you give us more detail on that.

    If you are running tis on S1 (system #1), how are you checking for data on S2 & S3?

    41,380 pointsBadges:
    report
  • TomLiotta

    The first question has to be "What is a 'file system' in your question?" The term 'file system' has a meaning that doesn't seem to have anything to do with the code that you showed. I might guess that mean that you have files in different libraries or that the application library has multiple files holding data for different uses, but it's not clear at all.

    As for the code, the first immediate problem seems to be at the SETLL. There is no test to see if SETLL returned a %EQUAL() result. The READE and the DOW loop shouldn't be done unless %EQUAL() is true. We can't say what should happen if it's not %EQUAL(); that's up to your logical requirements.

    Then, your question refers to "2009" but your code seems to check for "2007" instead. Maybe it's a typo in your question or it's a typo in your code.

    But also as CharlieBrowne said, we don't know what problem you're seeing. How do you know "its not working correctly"? What are you seeing that makes you believe that?

    Tom

    125,585 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following