forked from alura-cursos/cursoopencobol
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcomando-copy.cbl
49 lines (41 loc) · 1.38 KB
/
comando-copy.cbl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
IDENTIFICATION DIVISION.
PROGRAM-ID. PRGCOB18.
******************************************************
*** AREA DE COMENTARIOS - REMARKS
*** OBJETIVO DO PROGRAMA = PERFORM COM REPETICOES CONTROLADAS
*** POR SAIDA FORCADA (UNTIL)
*** USANDO BOOK
*** AUTOR: HEITOR JR
*** DATA : 24/09/2024
******************************************************
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
SPECIAL-NAMES.
DECIMAL-POINT IS COMMA.
DATA DIVISION.
WORKING-STORAGE SECTION.
COPY 'BOOK.CPY'.
PROCEDURE DIVISION.
0001-PRINCIPAL.
PERFORM 0100-INICIALIZAR
IF WRK-VENDAS GREATER 0
PERFORM 0200-PROCESSAR UNTIL WRK-VENDAS = 0
END-IF
PERFORM 0300-FINALIZAR
STOP RUN
.
0100-INICIALIZAR.
DISPLAY 'DIGITE O NUMERO..... : '
ACCEPT WRK-VENDAS
.
0200-PROCESSAR.
ADD 1 TO WRK-QT
ADD WRK-VENDAS TO WRK-ACUM
PERFORM 0100-INICIALIZAR
.
0300-FINALIZAR.
DISPLAY '---------------------'
DISPLAY 'TOTAL DAS VENDAS ' WRK-ACUM
DISPLAY 'QUANTIDADE DE VENDAS ' WRK-QT
DISPLAY ' FIM DE PROCESSAMENTO '
.