Chinaunix首页 | 论坛 | 博客
  • 博客访问: 69527
  • 博文数量: 5
  • 博客积分: 674
  • 博客等级: 上士
  • 技术积分: 180
  • 用 户 组: 普通用户
  • 注册时间: 2006-02-05 23:54
文章分类
文章存档

2012年(2)

2011年(1)

2009年(2)

最近访客

分类:

2009-12-02 14:13:40

第一个程序 cl
             PGM                                                      
             DCL        VAR(&KB) TYPE(*CHAR) LEN(1)                   
             CHGVAR VAR(&KB) VALUE('0')                               
             CLRPFM     FILE(HISOFT3/TKTSSQL)                         
             CLRPFM     FILE(HISOFT3/TKTSDDSSRC)                      
             DSPFD      FILE(HISOFT3/QSQLSRC) TYPE(*MBRLIST) +        
                          OUTPUT(*OUTFILE) OUTFILE(HISOFT3/TKTSSQL)   
             CALL       PGM(HISOFT3/DOWNSQL)                          
             CHKOBJ     OBJ(HISOFT3/TOOLDDSSRC) OBJTYPE(*FILE)        
             MONMSG     MSGID(CPF9801) EXEC(CHGVAR VAR(&KB) VALUE('1'))
             IF COND(&KB *NE '1') THEN(DO)                            
             DLTF       FILE(HISOFT3/HIZLDDSSRC)                      
             ENDDO                                                    
             CPYF       FROMFILE(HISOFT3/TKTSDDSSRC) +                
                          TOFILE(HISOFT3/HIZLDDSSRC) CRTFILE(*YES)    
             ENDPGM                                     
 
         第二个程序downup sqlrpg
     FMYMBR   IF  E                    DISK                            
     ITBL         DS                             21                    
     I I            'NF'                      1   2 TBL1               
     I I            'NFTYP'                   3   7 TBL2               
     I I            'WH'                      8   9 TBL3               
     I I            'NFL1'                   10  13 TBL4               
     I I            'NFL2'                   14  17 TBL5               
     I I            'NFL3'                   18  21 TBL6               
     C*****************************************************************
     C*DDS                                                             
     C*****************************************************************
     C           *ENTRY    PLIST                                       
     C                     PARM           MLLIB  10                    
     C                     PARM           MLFILE 10                    
     C                     PARM           MLNAME 10                    
     C                     PARM           MLSEU   4                    
     C*****************************************************************
     C                     EXSR @DDS                                   
     C*****************************************************************
     C**                                                               
     C*****************************************************************
     C/EXEC SQL COMMIT                                                 
     C/END-EXEC                                                        
     C                     SETON                     LR                
     C                     RETRN                                       
     C*****************************************************************
     C           @DDS      BEGSR                                       
     C*****************************************************************
     C                     READ MYMBR                    91            
     C           *IN91     DOWEQ*OFF                                   
     C                     Z-ADD*ZERO     POS     20                   
     C                     EXSR @CHK                                   
     C           POS       IFNE *ZERO                                 
     C/EXEC SQL                                                       
     C+ INSERT INTO HISOFT3/TKTSDDSSRC VALUES(:MLLIB, :MLFILE, :MLNAME,
     C+ :MLSEU, :SRCSEQ, :SRCDTA, :SRCDAT)                            
     C/END-EXEC                                                       
     C                     ENDIF                                      
     C                     READ MYMBR                    91           
     C                     ENDDO                                      
     C                     ENDSR                                      
     C*********************************************************       
     C           @CHK      BEGSR                                      
     C*********************************************************       
     C           TBL1      SCAN SRCDTA    POS                         
     C           POS       IFEQ *ZERO                                 
     C           TBL2      SCAN SRCDTA    POS                         
     C                     ENDIF                                      
     C           POS       IFEQ *ZERO                          
     C           TBL3      SCAN SRCDTA    POS                  
     C                     ENDIF                               
     C           POS       IFEQ *ZERO                          
     C           TBL4      SCAN SRCDTA    POS                  
     C                     ENDIF                               
     C           POS       IFEQ *ZERO                          
     C           TBL5      SCAN SRCDTA    POS                  
     C                     ENDIF                               
     C           POS       IFEQ *ZERO                          
     C           TBL6      SCAN SRCDTA    POS                  
     C                     ENDIF                               
     C                     ENDSR                               
第三个程序downsql
     FTKTSSQL IF  E                    DISK                            
     F            QWHFDML                           KRENAMERPGR        
     C*****************************************************************
     C**RPG                                                            
     C*****************************************************************
     C                     READ TKTSSQL                  90            
     C           *IN90     DOWEQ*OFF                                   
     C                     CALL 'CPYFTST'                              
     C                     PARM           MLLIB                        
     C                     PARM           MLFILE                       
     C                     PARM           MLNAME                       
     C                     CALL 'DOWNUP'                               
     C                     PARM           MLLIB                        
     C                     PARM           MLFILE                       
     C                     PARM           MLNAME                       
     C                     PARM           MLSEU                        
     C                     READ TKTSSQL                  90            
     C                     ENDDO                                       
     C*****************************************************************
     C                     SETON                     LR                
     C                     RETRN                                       
第四个程序CPYFTST
*************** Beginning of data *************************************
             PGM        PARM(&LIBS &SRCS &FILES)                       
             DCL        VAR(&LIBS) TYPE(*CHAR) LEN(10)                 
             DCL        VAR(&FILES) TYPE(*CHAR) LEN(10)                
             DCL        VAR(&SRCS) TYPE(*CHAR) LEN(10)                 
             DCL        VAR(&KB) TYPE(*CHAR) LEN(1)                    
             CHGVAR VAR(&KB) VALUE('0')                                
             CHKOBJ     OBJ(HISOFT3/MYMBR) OBJTYPE(*FILE)              
             MONMSG     MSGID(CPF9801) EXEC(CHGVAR VAR(&KB) VALUE('1'))
             IF COND(&KB *EQ '1') THEN(DO)                             
             CPYF       FROMFILE(&LIBS/&SRCS) TOFILE(HISOFT3/MYMBR) +  
                          CRTFILE(*YES)                                
             ENDDO                                                     
             CHKOBJ     OBJ(&LIBS/&SRCS) OBJTYPE(*FILE) MBR(&FILES)    
             MONMSG     MSGID(CPF9815) EXEC(GOTO CMDLBL(END))          
             CLRPFM     FILE(HISOFT3/MYMBR)                            
             CPYF       FROMFILE(&LIBS/&SRCS) TOFILE(HISOFT3/MYMBR) +  
                         FROMMBR(&FILES) MBROPT(*ADD) +   
                         FMTOPT(*NOCHK)                   
            MONMSG     MSGID(CPF2817)                     
END:        ENDPGM                                              
阅读(848) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~