我正在研究 Cobol,但是在读取文件时遇到问题,cobol 将文件的状态返回为 35...我在互联网上查看了这个状态是什么,据我了解是系统确实找不到该文件,但我在与可执行文件相同的目录中创建了该文件,其中包含系统应识别的列...
我该如何解决这个问题?
IDENTIFICATION DIVISION.
PROGRAM-ID. EXCLI.
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
SPECIAL-NAMES.
DECIMAL-POINT IS COMMA.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT ARQCLI ASSIGN TO DISK
ORGANIZATION INDEXED
ACCESS MODE DYNAMIC
RECORD KEY FD-CODIGO
FILE STATUS FS.
DATA DIVISION.
FILE SECTION.
FD ARQCLI LABEL RECORD STANDARD
VALUE OF FILE-ID IS "ARQCLI.DAT".
01 REG-ARQCLI.
02 FD-CODIGO.
03 CODIGO PIC 9(04).
02 FD-NOME PIC X(30).
02 FD-END PIC X(30).
02 FD-BAIRRO PIC X(20).
02 FD-CIDADE PIC X(20).
02 FD-CEP PIC 9(05).
WORKING-STORAGE SECTION.
77 WS-SPACE PIC X(40) VALUE SPACES.
77 FS PIC X(02) VALUE SPACES.
77 WS-FUNC PIC 9 VALUE ZERO.
77 MSG PIC X(09) VALUE SPACES.
77 WS-CONF PIC X VALUE SPACE.
01 WS-DATA-SIS.
02 AA PIC 9(02) VALUE ZEROS.
02 MM PIC 9(02) VALUE ZEROS.
02 DD PIC 9(02) VALUE ZEROS.
01 WS-MENSAGENS.
02 MENSA1 PIC X(30) VALUE "FUNÇÃO ERRADA - REDIGITE".
02 MENSA2 PIC X(30) VALUE "CAMPO INVALIDO".
02 MENSA3 PIC X(30) VALUE "CLIENTE JÁ CADASTRADO".
02 MENSA4 PIC X(30) VALUE "CLIENTE NÃO CADASTRADO".
SCREEN SECTION.
01 TELA1.
02 BLANK SCREEN.
02 LINE 01 COLUMN 01 VALUE "EM:".
02 LINE 01 COLUMN 26 VALUE "CADASTRO DE CLIENTES" REVERSE-VIDEO.
02 LINE 03 COLUMN 19 VALUE "AUTOR: ALEXANDRE SAVELLI BENCZ".
02 LINE 06 COLUMN 29 VALUE "FUNÇÃO DESEJADA: < >".
02 LINE 08 COLUMN 29 VALUE "< 1 > INCLUSÃO".
02 LINE 10 COLUMN 29 VALUE "< 2 > ALTERAÇÃO".
02 LINE 12 COLUMN 29 VALUE "< 3 > EXCLUSÃO".
02 LINE 14 COLUMN 29 VALUE "< 4 > CONSULTA".
02 LINE 16 COLUMN 29 VALUE "< 5 > FIM".
05 LINE 21 COLUMN 29 VALUE "MENSAGEM:".
01 TELA-OPCAO.
02 LINE 06 COLUMN 39 PIC X(09) USING MSG REVERSE-VIDEO.
PROCEDURE DIVISION.
INICIO.
OPEN I-O ARQCLI.
IF FS NOT = "00"
IF FS = "30"
CLOSE ARQCLI OPEN OUTPUT ARQCLI CLOSE ARQCLI
GO TO INICIO
ELSE
DISPLAY "FILE STATUS --->" LINE 24 COLUMN 35
DISPLAY FS LINE 24 COLUMN 52
STOP RUN
ELSE
NEXT SENTENCE.
ACCEPT WS-DATA-SIS FROM DATE.
TELA.
DISPLAY TELA1.
FIM.
STOP RUN.