Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1269061
  • 博文数量: 287
  • 博客积分: 11000
  • 博客等级: 上将
  • 技术积分: 3833
  • 用 户 组: 普通用户
  • 注册时间: 2007-08-16 08:43
文章分类
文章存档

2013年(15)

2012年(17)

2011年(17)

2010年(135)

2009年(85)

2008年(18)

分类: 系统运维

2010-02-17 10:04:07


一维的DS的定义:
d RecDsSet             ds                             likeds(RecDs) dim(100)
* 1)
d RecDs                ds                             qualified
    fld1                                       10     inz
    fld2                                        3s  0 inz
    fld3                                       50     inz
    .....
2)
fMyFile  if  a               disk
f                                                     rename(rec:rec01)
 * 
d RecDsSet             ds                             likeds(RecDs) dim(100)
 * 2)OS/400 V5R4以上版本
dRecDs                ds                               likerec(rec01)   
 * 3)OS/400 V5R3以下版本
dRecDs                ds                               extname(MyFile)   
 
二维的数组定义和使用:
D Array            S               20    Dim(5)
D ArrPointer       S                 *   Inz(%Addr(Array))     
D ArrOptRow        DS                    Dim(5) Qualified       
D                                                Based(ArrPointer)       
D   ArrOptCol                       3    Dim(4)                 
 *
d             s              100     varying
d             s               2s 0  inz
d             s               2s 0  inz
 *
 /free
      ....
      = 1;
         = 1;
      = 'Hello, World!';
      ArrOptRow() = ;
      ....
 /end-free
阅读(1035) | 评论(0) | 转发(1) |
给主人留下些什么吧!~~