cobol做画面,不能显示记录,请各位大侠帮忙。
dspf如下:
A*%%TS SD 20101130 121006 TEST1 REL-V5R3M0 5722-WDS
A*%%EC
A DSPSIZ(24 80 *DS3)
A INDARA
A PRINT
A CF03(99 'EXIT')
A R SFL01 SFL
A*%%TS SD 20101130 114609 TEST1 REL-V5R3M0 5722-WDS
A ELEMTYPE R O 6 11REFFLD(PGMFREC/ELEMTYPE TESTLIB/PGMF)
A DSPATR(HI)
A PGMFLEV R O 6 28REFFLD(PGMFREC/PGMFLEV TESTLIB/PGMF)
A DSPATR(HI)
A R SCL01 SFLCTL(SFL01)
A*%%TS SD 20101130 121006 TEST REL-V5R3M0 5722-WDS
A BLINK
A OVERLAY
A 90 98 PUTOVR
A 90 SFLDSP
A N91N92 SFLDSPCTL
A 91 SFLINZ
A 92 SFLCLR
A N93 SFLEND
A SFLPAG(0010)
A SFLSIZ(1000)
A 2 10DATE
A EDTCDE(Y)
A 2 64SYSNAME
A 4 10USER
A 2 29'PGMF'
A 5 11'Element Type'
A 5 28'Promote Lock Level'
A R SFL01T
A*%%TS SD 20101130 115332 TEST REL-V5R3M0 5722-WDS
A 21 11'F3=Exit'
cobol如下:
IDENTIFICATION DIVISION.
*
PROGRAM-ID. TESTPGM.
AUTHOR. TEST1.
DATE-WRITTEN. 2010-12-01.
DATE-COMPILED. 2010-12-01.
***************************************************************
*
*2222222222
***************************************************************
ENVIRONMENT DIVISION.
*
CONFIGURATION SECTION.
SOURCE-COMPUTER. AS400.
OBJECT-COMPUTER. AS400.
*
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT DISPFILE
ASSIGN TO WORKSTATION-TEST26
ORGANIZATION IS TRANSACTION
ACCESS IS SEQUENTIAL.
*
**************************************************************
*
*3333333333
**************************************************************
DATA DIVISION.
*
FILE SECTION.
FD DISPFILE
LABEL RECORDS ARE OMITTED
DATA RECORD IS DISP-REC.
01 DISP-REC.
COPY DDS-ALL-FORMATS OF TEST26.
05 SFL01-I REDEFINES TEST26-RECORD.
06 SFL01-I-INDIC.
07 IN99 PIC 1 INDIC 99.
05 SCL01-I REDEFINES TEST26-RECORD.
06 ELEMTYPE PIC X(4).
06 PRLKLEV PIC X(6).
05 SCL01-O REDEFINES TEST26-RECORD.
06 ELEMTYPE PIC X(4).
06 PRLKLEV PIC X(6).
WORKING-STORAGE SECTION.
*
77 IND-OFF PIC 1 VALUE B"0".
77 IND-ON PIC 1 VALUE B"1".
*
*************************************************************
*
PROCEDURE DIVISION.
*
BEGIN.
OPEN I-O DISPFILE.
*
PERFORM DISPLAY-SCREEN THRU READ-AND-PROCESS-SCREEN
UNTIL IN99 IN SFL01-I-INDIC = IND-ON.
CLOSE DISPFILE.
STOP RUN.
DISPLAY-SCREEN.
WRITE DISP-REC FROM SFL01-O FORMAT IS "SCL01"
INDICATORS ARE SFL01-I-INDIC.
READ-AND-PROCESS-SCREEN.
MOVE "CCCC" TO ELEMTYPE OF SFL01-O.
MOVE "DDDDDD" TO PRLKLEV OF SFL01-O.
MOVE ELEMTYPE OF SFL01-O TO ELEMTYPE OF SFL01-I.
MOVE PRLKLEV OF SFL01-O TO PRLKLEV OF SFL01-I.
READ DISPFILE INTO SCL01-I FORMAT IS "SCL01"
INDICATORS ARE SFL01-I-INDIC.
可显示画面,但不能显示记录,请各位帮忙,谢谢!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(8)
还有一个问题:
在dspf中的scl放置一个输入型的字段,在cobol中执行
MOVE XXX OF SCL01-I TO YYY
DISPLAY YYY.
比如输入:AAA,
显示出来的是0AA,(按退出时显示为1)
怀疑第一个是控制字符,请问各位如何取到正确的值给YYY?
谢谢。
谢谢netdoger和jxylh111018,
问题已得到解决,原来是程序对参数设置有问题。
***
SFLDSP
SFLDSPCTL
SFLINZ
SFLDLT
SFLCLR
SFLEND
***
在画面上这些参数 都没制定好。 还有你写的COBOL逻辑上有问题。以下是我大概写的 希望对你有帮助。
BEGIN.
OPEN I-O DISPFILE.
MAIN-LOOP.
PERFORM DISPLAY-SCREEN THRU DISPLAY-SCREEN-EXIT.
WRITE DISP-REC FROM SCL01-O FORMAT IS "SCL01"
INDICATORS ARE SCL01-I-INDIC.
READ DISPFILE INTO SCL01-I FORMAT IS "SCL01"
INDICATORS ARE SFL01-I-INDIC.
IF FILE-CA = '03'
CLOSE DISPFILE
GO BACK
END-IF.
GO TO MAIN-LOOP
MAIN-EXIT.
**********************
DISPLAY-SCREEN.
MOVE ZERO TO RRN1.
WRITE DISP-REC FROM SFL01-O FORMAT IS "SCL01"
INDICATORS ARE SFL01-I-INDIC.
MOVE "CCCC" TO ELEMTYPE OF SFL01-O.
MOVE "DDDDDD" TO PRLKLEV OF SFL01-O.
MOVE ELEMTYPE OF SFL01-O TO ELEMTYPE OF SFL01-I.
MOVE PRLKLEV OF SFL01-O TO PRLKLEV OF SFL01-I.
ADD 1 TO RRN1.
WRITE DISP-REC FROM SFL01-O FORMAT IS "SFL01"
INDICATORS ARE SFL01-I-INDIC.
DISPLAY-SCREEN-EXIT.
EXIT.
各位大侠,请帮忙。。。。。。
谢谢netdoger.
各位,请帮忙。顺便说下环境:as400 os 版本v5r4.
可惜现在没有机器测试,否则我可以试试
netdoger ,谢谢你的回答,但经测试可以显示画面,但记录一样显示不出来。
http://blog.sina.com.cn/s/blog_5f18ff880100dcxr.html
这是我过去写的,不知道是否对你有帮助?