PROGRAMA COBOL
Por: jorge012 • 7/9/2015 • Pesquisas Acadêmicas • 7.792 Palavras (32 Páginas) • 367 Visualizações
*----------------------------------------------------------------*
*OBJETIVO: *
*----------------------------------------------------------------*
IDENTIFICATION DIVISION.
*----------------------------------------------------------------*
PROGRAM-ID. GPAZ4006.
AUTHOR. JORGE
*----------------------------------------------------------------*
ENVIRONMENT DIVISION.
*----------------------------------------------------------------*
CONFIGURATION SECTION.
SPECIAL-NAMES.
DECIMAL-POINT IS COMMA.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT CLIOLD ASSIGN TO UT-S-CLIOLD
FILE STATUS IS FS-CLIOLD
.
SELECT CLIMOV ASSIGN TO UT-S-CLIMOV
FILE STATUS IS FS-CLIMOV
.
SELECT CLINEW ASSIGN TO UT-S-CLINEW
FILE STATUS IS FS-CLINEW
.
*----------------------------------------------------------------*
DATA DIVISION.
*----------------------------------------------------------------*
FILE SECTION.
FD CLIOLD
LABEL RECORD STANDARD
BLOCK CONTAINS 0 RECORDS
RECORDING MODE IS F
RECORD CONTAINS 80 CHARACTERS
DATA RECORD IS REG-CLIOLD
.
01 REG-CLIOLD PIC X(80).
FD CLIMOV
RECORDING MODE IS F
LABEL RECORD STANDARD
BLOCK CONTAINS 0 RECORDS
RECORDING MODE IS F
RECORD CONTAINS 81 CHARACTERS
DATA RECORD IS REG-CLIMOV
.
01 REG-CLIMOV PIC X(81).
FD CLINEW
RECORDING MODE IS F
LABEL RECORD STANDARD
BLOCK CONTAINS 0 RECORDS
RECORDING MODE IS F
RECORD CONTAINS 79 CHARACTERS
DATA RECORD IS REG-CLINEW
.
01 REG-CLINEW PIC X(79).
*----------------------------------------------------------------*
WORKING-STORAGE SECTION.
COPY VARDATA.
COPY VARTEMPO.
01 FS-CLIOLD PIC X(02).
88 SUCESSO-OLD VALUE "00".
88 FIM-ARQ-OLD VALUE "10".
01 FS-CLIMOV PIC X(02).
88 SUCESSO-MOVE VALUE "00".
88 FIM-ARQ-MOVE VALUE "10".
01 FS-CLINEW PIC X(02).
88 SUCESSO-NEW VALUE "00".
88 FIM-ARQ-NEW VALUE "10".
77 WS-CTLIDO-OLD PIC 9(04) COMP.
77 WS-CTLIDO-MOVE PIC 9(04) COMP.
77 WS-CTGRAV-NEW PIC 9(04) COMP.
77 WS-CTINC PIC 9(04) COMP.
77 WS-CTEXC PIC 9(04) COMP.
77 WS-CTALT PIC 9(04) COMP.
77 WS-CTLIDO-OLD-F PIC ZZZ9.
77 WS-CTLIDO-MOVE-F PIC ZZZ9.
77 WS-REG-CLINEW-F PIC ZZZ9.
77 WS-CTGRAV-NEW-F PIC ZZZ9.
77 WS-CTINC-F PIC ZZZ9.
77 WS-CTEXC-F PIC ZZZ9.
77 WS-CTALT-F PIC ZZZ9.
77 WS-MSG PIC X(60).
77 WS-FS PIC X(02).
01 WS-DADOS-ENVIADOS.
...