免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 3729 | 回复: 8
打印 上一主题 下一主题

subfile中readc的疑问 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2010-09-28 13:32 |只看该作者 |倒序浏览
本帖最后由 rise720 于 2010-09-28 13:33 编辑

设计了一个subfile,其中,只有option字段是可输入的. 希望是在subfile中通过用'1'选择某条记录,然后进行操作

我原意是用readc循环查找subfile中修改过的记录,即标记'1'的记录

但发现所有记录,包括没做任何操作的记录,也被readc读了出来.请问下为什么? 需要注意什么地方么?

论坛徽章:
0
2 [报告]
发表于 2010-09-28 13:38 |只看该作者
能不能把那段代码贴上来,这么说不是很明确

论坛徽章:
0
3 [报告]
发表于 2010-09-28 13:49 |只看该作者
本帖最后由 rise720 于 2010-09-28 13:50 编辑
  1. A          R SFL01                     SFL         
  2. A                                      SFLNXTCHG   
  3. A            S1OPT          1A  B  7  2            
  4. A  39                                  DSPATR(RI)  
  5. A  39                                  DSPATR(PC)  
  6. A            S1CSC1         4A  O  7 10            
  7. A            S1CSC2         2A  O  7 15            
  8. A            S1CSC3         2A  O  7 18            
复制代码
  1. C                     Z-ADD0         W1RRN               
  2. C                     READCSFL01                    80   
  3. C           *IN80     DOWEQ*OFF                           
  4. C           S1OPT     IFNE '1'                           
  5. C                     SETON                     39      
  6. C                     UPDATSFL01                        
  7. C           *IN99     IFEQ *OFF                          
  8. C                     SETON                     99      
  9. C                     MOVELMSG,2     D9MSG     P         
  10. C                     ENDIF                              
  11. C                     LEAVE                              
  12. C                     ELSE                              
  13. C           W1RRN     IFEQ 0                             
  14. C                     Z-ADDRRN1      W1RRN               
  15. C                     ELSE                              
  16. C                     SETON                     39         
  17. C                     UPDATSFL01                           
  18. C           *IN99     IFEQ *OFF                           
  19. C                     SETON                     99         
  20. C                     MOVELMSG,3     D9MSG     P           
  21. C                     ENDIF                                
  22. C                     LEAVE                                
  23. C                     ENDIF                                
  24. C                     ENDIF                                
  25. C                     READCSFL01                    80     
  26. C                     ENDDO                                
复制代码
麻烦了!

论坛徽章:
1
操作系统版块每日发帖之星
日期:2015-08-03 06:20:00
4 [报告]
发表于 2010-09-28 13:58 |只看该作者
DDS 中SFLNXTCHG  keyword放到S1OPT      下面你试试,

请教你源代码怎样复制贴的这样漂亮的?

论坛徽章:
0
5 [报告]
发表于 2010-09-28 14:07 |只看该作者
DDS 中SFLNXTCHG  keyword放到S1OPT      下面你试试,

请教你源代码怎样复制贴的这样漂亮的?
tomroom 发表于 2010-09-28 13:58


试过了,不行. SFLNXTCHG是RECORD LEVEL的keyword吧?

要复制代码的话,只要点编辑帖子里的工具栏 '代码' 一栏即可

论坛徽章:
0
6 [报告]
发表于 2010-09-28 14:17 |只看该作者
SFLNXTCHG 加一個指示器 如66

SETON                66
UPDATSFL01
SETOF                66

论坛徽章:
0
7 [报告]
发表于 2010-09-28 15:12 |只看该作者
回复 6# NINERI

确实如此,谢谢回复!

在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.

论坛徽章:
0
8 [报告]
发表于 2010-09-29 12:51 |只看该作者
不会看源码,只会在SDU上弄

论坛徽章:
0
9 [报告]
发表于 2010-10-10 22:01 |只看该作者
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP