我想从 COBOL 中的 STDIN(又名 SYSIN)中读取行。现在我只想把它们打印出来,这样我就知道我有它们了。从我正在阅读的所有内容来看,这应该可以工作:
IDENTIFICATION DIVISION.
PROGRAM-ID. APP.
ENVIRONMENT DIVISION.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT SYSIN ASSIGN TO DA-S-SYSIN ORGANIZATION LINE SEQUENTIAL.
DATA DIVISION.
FILE SECTION.
FD SYSIN.
01 ln PIC X(255).
88 EOF VALUE HIGH-VALUES.
WORKING-STORAGE SECTION.
PROCEDURE DIVISION.
OPEN INPUT SYSIN
READ SYSIN
AT END SET EOF TO TRUE
END-READ
PERFORM UNTIL EOF
DISPLAY ln
READ SYSIN
AT END SET EOF TO TRUE
END-READ
END-PERFORM
CLOSE SYSIN
STOP RUN.
编译(使用 open-cobol 和 cobc -x),但运行它我得到:
libcob: File does not exist (STATUS = 35) File : ''
我究竟做错了什么?