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) |