Chinaunix首页 | 论坛 | 博客
  • 博客访问: 183774
  • 博文数量: 39
  • 博客积分: 1950
  • 博客等级: 中尉
  • 技术积分: 445
  • 用 户 组: 普通用户
  • 注册时间: 2010-06-04 10:28
文章分类

全部博文(39)

文章存档

2017年(1)

2011年(1)

2010年(37)

分类:

2010-09-28 15:56:47

SFLNXTCHG的作用: 
一般,SFLNXTCHG是配合readc使用.
当通过READC读SUBFILE中修改过的记录时,如果发现有错误,则在程序里将SFLNXTCHG的指示器置*ON.这样,在下次EXFMT之后readc时,即使改记录没有改动,也会标示出来.因为SFLNXTCHG将他标为改动过.

for example:( 代码逻辑有点问题,但不影响SFLNXTCHG的举例 )

A          R SFL01                     SFL            
A  41                                  SFLNXTCHG      


C                     Z-ADD0         W1RRN            
C                     READCSFL01                    80
C           *IN80     DOWEQ*OFF                       
C** THE S1OPT FILD MUST BE INPUTED '1' ONLY ONCE      
C           S1OPT     IFNE '1'                        
C                     SETON                     3941  
C                     UPDATSFL01                      
C                     SETOF                     41    
C           *IN99     IFEQ *OFF                       
C                     SETON                     99    
C                     MOVELMSG,2     D9MSG     P      
C                     ENDIF                           
C                     LEAVE                           
C                     ELSE                            
C           W1RRN     IFEQ 0                          
C                     Z-ADDRRN1      W1RRN            
C                     ELSE                             
C                     SETON                     3941   
C                     UPDATSFL01                       
C                     SETOF                     41     
C           *IN99     IFEQ *OFF                        
C                     SETON                     99     
C                     MOVELMSG,3     D9MSG     P       
C                     ENDIF                            
C                     LEAVE                            
C                     ENDIF                            
C                     ENDIF                            
C                     READCSFL01                    80 
C                     ENDDO                            


下面是reference的介绍:

Subfile operations with SFLNXTCHG
If the program detects typing errors in the changed records, it can send update operations (UPDATE in RPG IV, REWRITE SUBFILE in COBOL) to the subfile records in error, setting indicators so that SFLNXTCHG is in effect during the update operations. These update operations are sent to the subfile record format.
After all the records in error have been updated, the program sends an input/output operation to the subfile-control record format to display the subfile again. With the subfile displayed again, the workstation user types the data again and presses the Enter key. If the data is correct, the program does not display the subfile again. The records in error (and any other records changed by the workstation user) are returned to the program on the next get-next-changed operation. This is because SFLNXTCHG caused the subfile records to be considered changed even though the workstation user did not change them. This allows the program to prohibit the workstation user from ignoring program-detected typing errors in subfile records.

Subfile operations without SFLNXTCHG
If SFLNXTCHG is not specified, or is specified but not selected on the update operations to the subfile records, then the workstation user can press the Enter key instead of correcting the program-detected errors. The program then reads no records because the get-next-changed operations find no changed records the second time the Enter key is pressed. Option indicators are valid for this keyword.

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

上一篇:文件异常/错误子例程

下一篇:CL操作QUERY

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