CICS 读取文件EIBRESP=22 EIBRESP2=11
- 2012年12月29日
- 由Leyond
EXEC CICS READ
INTO(RECORD)
FILE('MASTFILE')
RIDFLD(ACCTNO)
END-EXEC
MASTFILE是一个变长的文件,所以读取文件的时候,总是报错,说长度不对。DEBUG之,发现Eibresp =22,Eibresp2=11,解决方法:
查看了网址:
LENGTH(data-area)
specifies the length, as a halfword binary value, of the data area where the record is to be put. On completion of the READNEXT command, the LENGTH parameter contains the actual length of the record.
所以需要指定长度,LENGTH(FILE-LEN),且FILE-LEN定义为 PIC S9(4) COMP VALUE 99。
EXEC CICS READ
INTO(RECORD)
LENGTH(RECLEN)
FILE('MASTFILE')
RIDFLD(ACCTNO)
END-EXEC
