-
Notifications
You must be signed in to change notification settings - Fork 10
/
Criando Variavel com Indice
50 lines (47 loc) · 1.85 KB
/
Criando Variavel com Indice
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
49
IDENTIFICATION DIVISION.
PROGRAM-ID. PRGCOB19.
******************************************************
*** AREA DE COMENTARIOS - REMARKS
*** OBJETIVO DO PROGRAMA = TABELA DE MEMORIA (OCCURS)
*** VARIAVEL TIPO ARRAY
*** AUTOR: IVAN
*** DATA : XX/XX/20XX
******************************************************
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
SPECIAL-NAMES.
DECIMAL-POINT IS COMMA.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 WRK-MESES.
02 WRK-MES PIC X(9) OCCURS 12 TIMES.
01 DATA-SYSTEMA.
02 SYS-ANO PIC 9(4).
02 SYS-MES PIC 9(2).
02 SYS-DIA PIC 9(2).
PROCEDURE DIVISION.
0001-PRINCIPAL.
PERFORM 0100-INICIALIZAR.
PERFORM 0200-PROCESSAR.
PERFORM 0300-FINALIZAR
STOP RUN.
0100-INICIALIZAR.
ACCEPT DATA-SYSTEMA FROM DATE YYYYMMDD.
PERFORM 0400-MONTAMES.
0200-PROCESSAR.
DISPLAY SYS-DIA ' DE ' WRK-MES(SYS-MES) ' DE ' SYS-ANO.
0300-FINALIZAR.
DISPLAY ' FIM DE PROCESSAMENTO '.
0400-MONTAMES.
MOVE 'JANEIRO ' TO WRK-MES(01).
MOVE 'FEVEREIRO' TO WRK-MES(02).
MOVE 'MARCO ' TO WRK-MES(03).
MOVE 'ABRIL ' TO WRK-MES(04).
MOVE 'MAIO ' TO WRK-MES(05).
MOVE 'JUNHO ' TO WRK-MES(06).
MOVE 'JULHO ' TO WRK-MES(07).
MOVE 'AGOSTO ' TO WRK-MES(08).
MOVE 'SETEMBRO ' TO WRK-MES(09).
MOVE 'OUTUBRO ' TO WRK-MES(10).
MOVE 'NOVEMBRO ' TO WRK-MES(11).
MOVE 'DEZEMBRO ' TO WRK-MES(12).