Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1079161
  • 博文数量: 106
  • 博客积分: 9093
  • 博客等级: 中将
  • 技术积分: 2770
  • 用 户 组: 普通用户
  • 注册时间: 2006-06-01 17:22
文章分类

全部博文(106)

文章存档

2014年(1)

2012年(29)

2011年(32)

2010年(20)

2008年(24)

分类:

2010-03-18 17:13:28

1,DTAARA的创建
CRTDTAARA DTAARA(PTRLIB/UDA) TYPE(*CHAR) LEN(20)  
 
2,rpgle程序
方法1
DUDS_DS          UDS                  DTAARA('PTRLIB/UDA')             
D UDA1                    1     10                                     
D UDA2                   11     20                                     
C*                                                                     
C     *LOCK         IN        UDS_DS                                   
C                   MOVEL     'PTRLIB'      UDA1                       
C                   MOVEL     'DTAARA'      UDA2                       
C                   OUT       UDS_DS                                   
C                   UNLOCK    UDS_DS                                   
C     UDS_DS        DSPLY                                              
C*                                                                     
C                   SETON                                            LR
C                   RETURN                                             
 
方法2
DUDS_DS          UDS                                                  
D UDA1                    1     10                                     
D UDA2                   11     20                                     
C*    
C     *DTAARA       Define    UDA           UDS_DS                     
C     *LOCK         IN        UDS_DS                                   
C                   MOVEL     'PTRLIB'      UDA1                       
C                   MOVEL     'DTAARA'      UDA2                       
C                   OUT       UDS_DS                                   
C                   UNLOCK    UDS_DS                                   
C     UDS_DS        DSPLY                                              
C*                                                                     
C                   SETON                                            LR
C                   RETURN                                             
 
3,RPG程序
     IUDD         DS                                                   
     I                                        1  10 UDA1               
     I                                       11  20 UDA2               
     C           *NAMVAR   DEFN UDA       UDD                          
     C           *LOCK     IN   UDD
     C                     MOVEL'PTRLIB'  UDA1                         
     C                     MOVEL'DTAARA'  UDA2                         
     C                     OUT  UDD
     C                     UNLCKUDD
     C           UDD       DSPLY                                       
     C*                                                                
     C                     SETON                     LR                
     C                     RETRN                                       
 
 
*LDA处理
RPGLE程序
D                UDS                                                  
D  UDA1                   1     10                                    
D  UDA2                  11     20                                    
C                   MOVEL     'PTRLIB'      UDA1                      
C                   MOVEL     'DDDDD'       UDA2                      
C*                                                                    
C                   SETON                                        LR   
C                   RETURN                                            
 
RPG程序
     I           UDS                                         
     I                                        1  10 UDA1     
     I                                       11  20 UDA2     
     C                     MOVEL'PTRLIB'  UDA1               
     C                     MOVEL'DDDDD'   UDA2               
     C*                                                      
     C                     SETON                     LR      
     C                     RETRN               
              
例子仅供参考,欢迎讨论。
操作时别忘了把自己的库添加到库list中。
阅读(1832) | 评论(0) | 转发(2) |
0

上一篇:Data Queue

下一篇:rpg读取Spooled Files

给主人留下些什么吧!~~