大家好,COBOL程序不寫文件
我有DISP =順序文件(MOD,CATLG,CATLG) 我的程序做一個OPEN IO和它應該寫入文件 然而,當作業成功結束,文件仍然是空的..
我錯過了什麼?
FILE
REJECT DD DSN=FILEA,
DISP=(MOD,CATLG,CATLG),UNIT=TESTPACK,
DCB=(LRECL=109,BLKSIZE=0,RECFM=FB),
SPACE=(TRK,(3,1),RLSE)
COBOL Program:
FD REJECT-FILE
RECORDING MODE IS F
LABEL RECORDS ARE STANDARD
BLOCK CONTAINS 0 RECORDS
RECORD CONTAINS 109 CHARACTERS
DATA RECORD IS REJC-OUT-RECORD.
01 REJC-OUT-RECORD PIC X(109).
ADD-REJECTS-HEADER.
SKIP1
READ REJECT-FILE INTO RECORD-IN
EVALUATE WS-STATUS
WHEN '00'
CONTINUE
WHEN '10'
CLOSE REJECT-FILE
OPEN I-O REJECT-FILE
WRITE REJC-OUT-RECORD FROM WS-HEADER-REJ
END-EVALUATE.
嗨,大師!我終於明白了。似乎我的COBOL版本不支持在I-O模式下寫入...感謝您的幫助! – newbie 2011-04-19 03:54:02