限制AS400 RPG中的输出工作文件

时间:2013-07-15 22:35:11

标签: ibm-midrange rpgle

目前,我们需要限制这些临时工作文件的输出。原因是这些是巨大的主文件,并且需要永远运行。如果我们不创建文件* NOMAX,那么必须有人来回复消息以获得更多扩展,并且它保留了作业队列。目前,我们希望显示正确选择数据。但我添加了这些计数字段,但它并没有停止程序。

FARCMASAC  IF   E             DISK                                  
 * Order Header file - Keyed by Company and entity number           
FOEORH4    IF   E           K DISK                                  
 * Output file - Customers who hav no orders  - TRCMASAC PF         
FTRCMA1    UF A E           K DISK                                  
 * Customer Keycode BI file                                         
FZRCST1    IF   E           K DISK                                  
 * Output file - Customers who have no Keycode  - VRCSTKBI PF       
FVRCST1    UF A E           K DISK                                  
 * Address  Master file - ADRESSAD PF                               
FADRES1    IF   E           K DISK                                  
 * Output file - Address  - ZDRESSAD PF                             
FZDRES1    UF A E           K DISK                                  

 *----------------------------------------------------------------- 
 * Calculation Specification                                        
 *----------------------------------------------------------------- 
 * Step 1                                                           
C                   READ      ARCMASAC                              
C                   DOW       NOT %EOF                      
 *                                                          
 * Check the record does not exist in order header file     
C                   EXSR      CHKORH_SR                     
 * Read the next record                                     
C                   READ      ARCMASAC                      
c     counta        ifge      9990                          
C                   EVAL      *INLR = *ON                   
c                   leave                                   
c                   endif                                   
c     countz        ifge      9990                          
C                   EVAL      *INLR = *ON                   
c                   leave                                   
c                   endif                                   
C                   ENDDO                                   

 * Step 2 and 3                                             
C     *LOVAL        SETLL     TRCMA1                        
C                   READ(N)   TRCMA1                        
C                   DOW       NOT %EOF                      

C                   EXSR      CHKCUS_SR                              
 *                                                                   
 * Check the record does not exist in address file                   
C                   EXSR      CHKADR_SR                              
 *                                                                   
 * Read the next record                                              
C                   READ(N)   TRCMA1                                 
C                   ENDDO                                            

 *-----------------------------------------------------------------  
 * End of the Program                                                
 *-----------------------------------------------------------------  
C                   EVAL      *INLR = *ON                            

 *-----------------------------------------------------------------  
 * Check the order header entity                                     
 *-----------------------------------------------------------------  
C     CHKORH_SR     BEGSR                                            
C     ORHKEY        CHAIN     OEORH4                                    
 * If the order entity is notfound, write the rec into TRCMASAC file    
C                   IF        NOT %FOUND(OEORH4)                        
C                   WRITE     TRCMASRR                                  
C                   ENDIF                                               
 *                                                                      
C                   ENDSR                                               
 *-----------------------------------------------------------------     
 * Check the customer keycode entity                                    
 *-----------------------------------------------------------------     
C     CHKCUS_SR     BEGSR                                               
 *                                                                      
C     ORHKEY        CHAIN     ZRCST1                                    
 * If the order entity is found, write the rec into VRCSTKBI file       
C                   IF        %FOUND(ZRCST1)                            
C                   WRITE     VRCSTKRR                                  
c                   add       1             countz            500       
C                   ENDIF                                               
C                   ENDSR                                                

 *-----------------------------------------------------------------      
 * Check the address entity for records of never ordered                 
 *-----------------------------------------------------------------      
C     CHKADR_SR     BEGSR                                                
 *                                                                       
C     ACENT#        CHAIN     ADRES1                                     
 * If the order entity is found, write the rec into ZDRESSRR file        
C                   IF        %FOUND(ADRES1)                             
C                   WRITE     ZDRESSRR                                   
c                   add       1             counta            500        
C                   ENDIF                                                
 *                                                                       
C                   ENDSR                                                

 *-----------------------------------------------------------------      
 * Program Initialization Subroutine                                     
 *-----------------------------------------------------------------      
C     *INZSR        BEGSR                                                

1 个答案:

答案 0 :(得分:1)

您正在检查第一个counta循环中countzDO的值 - 但是在第二个DO循环之前,您没有将它们递增。

移动你的:

c     counta        ifge      9990                          
C                   EVAL      *INLR = *ON                   
c                   leave                                   
c                   endif                                   
c     countz        ifge      9990                          
C                   EVAL      *INLR = *ON                   
c                   leave                                   
c                   endif

代码进入第二个DO循环。