Chinaunix首页 | 论坛 | 博客
  • 博客访问: 354580
  • 博文数量: 90
  • 博客积分: 847
  • 博客等级: 准尉
  • 技术积分: 1373
  • 用 户 组: 普通用户
  • 注册时间: 2012-08-02 10:54
个人简介

跌打滚爬中的小菜鸟...

文章分类

全部博文(90)

文章存档

2015年(5)

2013年(47)

2012年(38)

我的朋友

分类: 其他UNIX

2013-09-18 15:49:42


RPG09

FMT FX FFilename++IPEASF.....L.....A.Device+.Keywords+++++++++++++++

        *************** Beginning of data ***************************

0001.00 FITEMLMAS  IF   E           K DISK                          

0002.00                                                             

0003.00 D RecKey          DS                  LikeRec(ITEMASEA:*key)

0004.00                                                             

0005.00  /free                                                      

0006.00   // set key then chain                                      

0007.00   Read ITEMASEA;                                            

0008.00   Eval RecKey.Itnbr='A10020-24';                            

0009.00   Eval RecKey.Recid='A';                                    

0010.00   Setgt %kds(Reckey) ITEMLMAS;                              

0011.00   If %Found(ITEMLMAS);                                      

0012.00     Dsply 'Found';                                          

0013.00   Else;                                                      

0014.00     Dsply 'Not Found';                                      

0015.00   Endif;              //如果不READP而直接READ的话则读到是第一条record!!!( ?H70843-19)本来我以为会是A10020-7!!!!

0016.00   Readp ITEMASEA;     //2013-7-16 14:10:29好吧,刚又试了下先READREADP发现直接读到了A10020-7!!!,太怪异了

0017.00   Dsply ITNBR;                                              

0018.00   DSPLY RECID;                                              

0019.00                                                             

0020.00   Read  ITEMASEA;              

0021.00   Dsply ITNBR;                  

0022.00   DSPLY RECID;                 

0023.00                                

0024.00   Eval *inlr=*on;              

0025.00   Return;                      

0026.00  /end-free                     

        ****************** End of data ***************************

 

 

RPG10

FMT FX FFilename++IPEASF.....L.....A.Device+.Keywords++++++++++++++

        *************** Beginning of data **************************

0001.00 FITEMLMAS  IF   E           K DISK                         

0002.00                                                            

0003.00 D RecKey          DS                  LikeRec(ITEMASEA:*key)

0004.00                                                            

0005.00  /free                                                      

0006.00   // set key then chain                                    

0007.00   Read ITEMASEA;                                           

0008.00   Eval RecKey.Itnbr='A10020-24';                           

0009.00   Eval RecKey.Recid='A';                                   

0010.00   Setll %kds(Reckey) ITEMLMAS;                             

0011.00   If %Equal(ITEMLMAS);                                     

0012.00     Dsply 'Found';                                         

0013.00   Else;                                                    

0014.00     Dsply 'Not Found';                                     

0015.00   Endif;                                                   

0016.00                                                             

0017.00   Eval *inlr=*on;                                          

0018.00   Return;                                                  

0019.00  /end-free                                                 

结果如下:

 

 

另外一个例子比较%Equal%Found的区别:

FMT FX FFilename++IPEASF.....L.....A.Device+.Keywords++++++++++++++

        *************** Beginning of data **************************

0001.00 FITEMLMAS  IF   E           K DISK                         

0002.00                                                             

0003.00 D RecKey          DS                  LikeRec(ITEMASEA:*key)

0004.00                                                            

0005.00  /free                                                      

0006.00   // set key then chain                                    

0007.00   Read ITEMASEA;                                           

0008.00   Eval RecKey.Itnbr='A10020-23';                           

0009.00   Eval RecKey.Recid='A';                                    

0010.00   Setll %kds(Reckey) ITEMLMAS;                             

0011.00   If %Equal(ITEMLMAS);      //记住,一般%Equal只用于SETLLLOOPUP

0012.00     Dsply 'Equal';                                         

0013.00   Else;                                                    

0014.00     Dsply 'Not Equal';                                     

0015.00   Endif;                                                   

0016.00                                                             

0017.00   If %Found(ITEMLMAS); //用于CHAIN,SETGT,SETLL,DELETE, CHECK,CHECKR,SCAN

0018.00     Dsply 'Found';                                         

0019.00   Else;                                                    

0020.00     Dsply 'Not Found';                              

0021.00   Endif;                                            

0022.00                                                     

0023.00   Eval *inlr=*on;                                   

0024.00   Return;                                            

0025.00  /end-free                                          

        ****************** End of data **********************

结果如下:  (最后那两个dsply)

阅读(1446) | 评论(0) | 转发(0) |
0

上一篇:chain

下一篇:convert 1130831 to a date variable

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