Programação Para Mainframe
Por: Guilherme Brandao • 22/9/2021 • Monografia • 2.068 Palavras (9 Páginas) • 177 Visualizações
Programação para Mainframe – Exercício 4 Data: 31/09/2021
Nome: Guilherme Valerio Brandão RA: 1047
Nome: Gabriel Camerato Vendrameto RA: 1038
Código-fonte do arquivo COBOL CGPRG004:
IDENTIFICATION DIVISION.
PROGRAM-ID. CGPRG004.
AUTHOR. CELSO GALLAO.
INSTALLATION. FATEC SAO CAETANO.
DATE-WRITTEN. 20/02/2019.
DATE-COMPILED. 31/08/2021.
SECURITY. NIVEL BASICO.
*--------------------------------------------------------------*
ENVIRONMENT DIVISION.
*====================*
CONFIGURATION SECTION.
*---------------------*
SPECIAL-NAMES.
DECIMAL-POINT IS COMMA
CURRENCY SIGN IS "R$ " WITH PICTURE SYMBOL "$"
.
INPUT-OUTPUT SECTION.
*---------------------*
FILE-CONTROL.
*==> LOCAL PARA O SELECT DOS ARQUVOS
DATA DIVISION.
*=============*
FILE SECTION.
*------------*
*==> LOCAL PARA A FD (DESCRICAO DOS ARQUIVOS)
WORKING-STORAGE SECTION.
*-----------------------*
*-----> AREA AUXILIAR
77 WS-FIM PIC X(01) VALUE "N".
77 WS-CTEXIB PIC 9(02).
77 AS-CEP PIC 9(08).
77 AS-FRENTE PIC 9(03)V99.
77 AS-COMP PIC 9(03)V99.
77 AS-VAL-M2 PIC 9(05)V99.
77 AS-VAL-VENDA PIC 9(08)V99.
77 AS-COMISSAO PIC 9(06)V99.
77 AS-DATA PIC 9(08).
77 AS-HORA PIC 99.99.9999.
77 WS-HORA-ATUAL PIC 99.99.9999.
77 WS-DATA-ATUAL PIC 99(08).
*-----> DADOS DE SAIDA VIA SYSOUT
01 WS-REG-SYSOUT.
05 WS-CEP PIC 9(08).
05 FILLER PIC X(01) VALUE SPACES.
05 WS-FRENTE PIC ZZ9,99.
05 FILLER PIC X(02) VALUE "M".
05 WS-COMP PIC ZZ9,99.
05 FILLER PIC X(02) VALUE "M".
05 WS-VAL-M2 PIC $$.$$9,99.
05 FILLER PIC X(03) VALUE "M2".
05 WS-VAL-VENDA PIC $$.$$$.$$9,99.
05 FILLER PIC X(01) VALUE SPACES.
05 WS-COMISSAO PIC $$$$.$$9,99.
05 FILLER PIC X(01) VALUE SPACES.
05 WS-MENSAGEM PIC X(12).
LINKAGE SECTION.
*----------------*
01 LK-PARAMETROS.
05 LK-NR-DPTO PIC 9(04).
05 LK-NOME-DPTO PIC X(15).
05 LK-COD-RETORNO PIC 99.
*
PROCEDURE DIVISION.
*--------------------------------------------------------------*
* PROCESSO PRINCIPAL *
*--------------------------------------------------------------*
PERFORM 010-INICIAR
PERFORM 030-PROCESSAR UNTIL WS-FIM = 'S'
PERFORM 050-TERMINAR
STOP RUN
.
*--------------------------------------------------------------*
* PROCEDIMENTOS INICIAIS *
*--------------------------------------------------------------*
010-INICIAR.
ACCEPT WS-HORA-ATUAL FROM TIME
ACCEPT WS-DATA-ATUAL FROM DATE
DISPLAY '** ATIVIDADE 4**'
DISPLAY 'GUILHERME BRANDAO - GABRIEL CAMERATO'
DISPLAY 'CALCULO DO PRECO DE VENDA DE UM TERRENO RETANGULAR'
DISPLAY "DATA DO CALCULO: " WS-DATA-ATUAL(8:2) "/"
WS-DATA-ATUAL(6:2) "/2" WS-DATA-ATUAL(3:3)
...