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

全部博文(106)

文章存档

2014年(1)

2012年(29)

2011年(32)

2010年(20)

2008年(24)

分类:

2010-03-29 14:31:49

例1:
D p1              S               *                             
D p2              S               *                             
D Result          S              1A   INZ                       
D Diff            S              5S 0 INZ                       
C                   alloc     20            p1                  
C                   EVAL      %STR(P1:20) ='abcdefghij'         
C                   EVAL      Result = %STR(P1:1)               
C                   DSPLY                   Result              
C                   EVAL      P2 = P1 + 8                       
C                   EVAL      Result = %STR(P2:1)               
C                   DSPLY                   Result              
C                   EVAL      P2 = P2 - 1                       
C                   EVAL      Result = %STR(P2:1)               
C                   DSPLY                   Result              
C                   EVAL      Diff = P2 - P1                    
C                   DSPLY                   Diff                
C                   DEALLOC                 P1                         
C*                                                                     
C                   SETON                                            LR
C                   RETURN                                             
 
例2:
H DATFMT(*ISO)                                                 
D Date            S               D   INZ(D'2010-03-29')       
D DatDS           DS                  BASED(PTR)               
D  YYYY                          4  0                          
D  Y_sep                         1                             
D  MM                            2  0                          
D  D_sep                         1                             
D  DD                            2  0    
D*                      
D PTR             S             16*                            
D vYear           S              4  0                          
D vMM             S              2  0                          
D vDD             S              2  0                          
C                   EVAL      PTR = %ADDR(Date)                
C                   EVAL      vYear  = YYYY                    
C                   EVAL      vMM = MM                         
C                   EVAL      vDD = DD                         
C                   DSPLY                   vYear                     
C                   DSPLY                   vMM                       
C                   DSPLY                   vDD                       
C*                                                                    
C                   SETON                                            LR
C                   RETURN                                            
 
阅读(1786) | 评论(0) | 转发(2) |
给主人留下些什么吧!~~