COBOL - I've comment some lines to repair them after
IDENTIFICATION DIVISION.
PROGRAM-ID. REDEFINE.
*
ENVIRONMENT DIVISION.
*
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT ENTRADA
ASSIGN TO ENTRADA.
*
DATA DIVISION.
*
FILE SECTION.
*
FD ENTRADA
LABEL RECORD IS STANDARD
RECORDING MODE IS F
RECORD CONTAINS 36 CHARACTERS.
*
01 REG-ENTRADA PIC X(36).
*
WORKING-STORAGE SECTION.
*
01 WS-REG-FILE.
05 WS-REG-INDEX PIC X(1).
05 WS-REG-ARQ PIC X(35).
05 WS-REG-HEADER REDEFINES WS-REG-ARQ.
10 WS-NOME-PGM PIC X(16).
10 WS-VERSAO-PGM PIC 9(6).
10 FILLER PIC X(13).
05 WS-REG-DETALHE REDEFINES WS-REG-ARQ.
10 WS-CONTA-CLI PIC 9(10).
10 WS-NOME-CLI PIC X(15).
10 WS-VALOR-CTA PIC 9(4).
10 WS-DATA-CTA PIC 9(6).
05 WS-REG-TRAILER REDEFINES WS-REG-ARQ.
10 WS-REG-QTD PIC 9(6).
10 FILLER PIC X(29).
77 WS-CONT PIC X(3) VALUE 'NAO'.
*
PROCEDURE DIVISION.
*
OPEN I-O ENTRADA
READ ENTRADA AT END MOVE 'SIM' TO WS-CONT.
*
* IF WS-REG-INDEX EQUAL 'H'
* MOVE WS-REG-ARQ TO WS-REG-HEADER
* ELSE
* IF WS-REG-INDEX EQUAL 'D'
* MOVE WS-REG-ARQ TO WS-REG-DETALHE
* ELSE
* IF WS-REG-INDEX EQUAL 'T'
* MOVE WS-REG-ARQ TO WS-REG-TRAILER
* ELSE
* DISPLAY "ERRO"
* END-IF
* END-IF
* END-IF
*
* DISPLAY WS-NOME-PGM
* DISPLAY WS-VERSAO-PGM
* DISPLAY WS-CONTA-CLI
* DISPLAY WS-NOME-CLI
* DISPLAY WS-DATA-CTA
* DISPLAY WS-REG-QTD
DISPLAY WS-CONT
*
CLOSE ENTRADA
STOP RUN.
PROGRAM-ID. REDEFINE.
*
ENVIRONMENT DIVISION.
*
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT ENTRADA
ASSIGN TO ENTRADA.
*
DATA DIVISION.
*
FILE SECTION.
*
FD ENTRADA
LABEL RECORD IS STANDARD
RECORDING MODE IS F
RECORD CONTAINS 36 CHARACTERS.
*
01 REG-ENTRADA PIC X(36).
*
WORKING-STORAGE SECTION.
*
01 WS-REG-FILE.
05 WS-REG-INDEX PIC X(1).
05 WS-REG-ARQ PIC X(35).
05 WS-REG-HEADER REDEFINES WS-REG-ARQ.
10 WS-NOME-PGM PIC X(16).
10 WS-VERSAO-PGM PIC 9(6).
10 FILLER PIC X(13).
05 WS-REG-DETALHE REDEFINES WS-REG-ARQ.
10 WS-CONTA-CLI PIC 9(10).
10 WS-NOME-CLI PIC X(15).
10 WS-VALOR-CTA PIC 9(4).
10 WS-DATA-CTA PIC 9(6).
05 WS-REG-TRAILER REDEFINES WS-REG-ARQ.
10 WS-REG-QTD PIC 9(6).
10 FILLER PIC X(29).
77 WS-CONT PIC X(3) VALUE 'NAO'.
*
PROCEDURE DIVISION.
*
OPEN I-O ENTRADA
READ ENTRADA AT END MOVE 'SIM' TO WS-CONT.
*
* IF WS-REG-INDEX EQUAL 'H'
* MOVE WS-REG-ARQ TO WS-REG-HEADER
* ELSE
* IF WS-REG-INDEX EQUAL 'D'
* MOVE WS-REG-ARQ TO WS-REG-DETALHE
* ELSE
* IF WS-REG-INDEX EQUAL 'T'
* MOVE WS-REG-ARQ TO WS-REG-TRAILER
* ELSE
* DISPLAY "ERRO"
* END-IF
* END-IF
* END-IF
*
* DISPLAY WS-NOME-PGM
* DISPLAY WS-VERSAO-PGM
* DISPLAY WS-CONTA-CLI
* DISPLAY WS-NOME-CLI
* DISPLAY WS-DATA-CTA
* DISPLAY WS-REG-QTD
DISPLAY WS-CONT
*
CLOSE ENTRADA
STOP RUN.
SYSOUT
IGZ0035S There was an unsuccessful OPEN or CLOSE of file ENTRADA in program REDEFINE at relative location X'0414'.
Neither FILE STATUS nor an ERROR declarative were specified. The status code was 35.
From compile unit REDEFINE at entry point REDEFINE at compile unit offset +00000414 at entry offset +00000414
at address 118AD414.
Neither FILE STATUS nor an ERROR declarative were specified. The status code was 35.
From compile unit REDEFINE at entry point REDEFINE at compile unit offset +00000414 at entry offset +00000414
at address 118AD414.