-
Notifications
You must be signed in to change notification settings - Fork 0
/
AZ08PGMM.txt
241 lines (225 loc) · 9.27 KB
/
AZ08PGMM.txt
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
*---------------------------------------------------------------*
IDENTIFICATION DIVISION.
*---------------------------------------------------------------*
PROGRAM-ID AZ08PGMM.
*---------------------------------------------------------------*
ENVIRONMENT DIVISION.
*---------------------------------------------------------------*
*---------------------------------------------------------------*
DATA DIVISION.
*---------------------------------------------------------------*
WORKING-STORAGE SECTION.
*---------------------------------------------------------------*
* COPY DA AREA DFHBMSCA - ATRIBUTOS
COPY DFHBMSCA.
* COPY DA AREA DFHAID - TECLAS PRESSIONADAS
COPY DFHAID.
* COPY DO MAPA SIMBOLICO AX08MNU
COPY AZ08MNU.
*
77 WS-MSG-ERRO PIC X(80).
77 WS-LENGTH PIC S9(04) COMP.
01 WS-DFHCOMMAREA.
05 WS-FASE PIC X(01).
01 WS-VAR-TEMPO.
05 WS-DATA PIC X(10).
05 WS-HORARIO PIC X(08).
*---------------------------------------------------------------*
LINKAGE SECTION.
*---------------------------------------------------------------*
01 DFHCOMMAREA.
05 OCCURS 0 TO 24576 TIMES DEPENDING ON EIBCALEN
PIC X(01).
*---------------------------------------------------------------*
PROCEDURE DIVISION.
*---------------------------------------------------------------*
EXEC CICS HANDLE CONDITION
MAPFAIL(999-MAPFAIL)
ERROR(999-ERROR)
END-EXEC
*---------------------------------------------------------------*
MOVE DFHCOMMAREA TO WS-DFHCOMMAREA
IF EIBCALEN EQUAL ZERO
MOVE '1' TO WS-FASE
END-IF
EVALUATE WS-FASE
WHEN '1' PERFORM 100-FASE1
WHEN '2' PERFORM 200-FASE2
WHEN OTHER
MOVE +80 TO WS-LENGTH
MOVE 'ERRO NO NUMERO DA FASE'
TO WS-MSG-ERRO
EXEC CICS SEND TEXT
FROM(WS-MSG-ERRO)
LENGTH(WS-LENGTH)
ERASE FREEKB ALARM
END-EXEC
EXEC CICS RETURN
END-EXEC
END-EVALUATE
.
*---------------------------------------------------------------*
100-FASE1.
* LIMPAR AS VARIAVES DO MAPA
MOVE LOW-VALUES TO MAPAMNUO
* POSICIONAR O CURSOR NO CAMPO T1OPC
MOVE -1 TO T1OPCL
* MOVER UMA MENSAGEM PARA O USUAIO
MOVE 'ENTRE A OPCAO DESEJADA' TO T1MSGO
* DEPROTEGER CAMPO T1OPC
MOVE DFHUNIMD TO T1OPCA
* CARREGAR AS VARIAVEIS DO MAPA E ENVIAR
PERFORM 999-MANDA-TELA
* ENCERRAR A TRANSACAO E CHAMAR A PROXIMA FASE
PERFORM 999-CHAMA-FASE2
.
*---------------------------------------------------------------*
200-FASE2.
EXEC CICS HANDLE AID
ENTER (210-ENTER)
PF3 (220-PF3)
PF5 (230-PF5)
CLEAR (230-PF5)
ANYKEY(240-ANYKEY)
END-EXEC
EXEC CICS RECEIVE
MAP('MAPAMNU')
MAPSET('AZ08MNU')
INTO(MAPAMNUI)
END-EXEC
.
*---------------------------------------------------------------*
210-ENTER.
IF T1OPCL = 0 OR T1OPCI = SPACES
MOVE 'ESCOLHA UMA OPCAO VALIDA E PRESSIONE ENTER'
TO T1MSGO
PERFORM 999-TRATA-FASE2
END-IF
EVALUATE T1OPCI
WHEN 'A'
MOVE '1' TO WS-FASE
EXEC CICS XCTL
PROGRAM('AZ08PGMA')
COMMAREA(WS-DFHCOMMAREA)
LENGTH(LENGTH OF WS-DFHCOMMAREA)
END-EXEC
WHEN 'B'
MOVE '1' TO WS-FASE
EXEC CICS XCTL
PROGRAM('AZ08PGMB')
COMMAREA(WS-DFHCOMMAREA)
LENGTH(LENGTH OF WS-DFHCOMMAREA)
END-EXEC
WHEN 'C'
MOVE '1' TO WS-FASE
EXEC CICS XCTL
PROGRAM('AZ08PGMC')
COMMAREA(WS-DFHCOMMAREA)
LENGTH(LENGTH OF WS-DFHCOMMAREA)
END-EXEC
WHEN 'D'
MOVE '1' TO WS-FASE
EXEC CICS XCTL
PROGRAM('AZ08PGMD')
COMMAREA(WS-DFHCOMMAREA)
LENGTH(LENGTH OF WS-DFHCOMMAREA)
END-EXEC
WHEN 'E' MOVE 'OPCAO E ESCOLHIDA' TO T1MSGO
WHEN 'F' MOVE 'OPCAO F ESCOLHIDA' TO T1MSGO
WHEN 'G' MOVE 'OPCAO G ESCOLHIDA' TO T1MSGO
WHEN 'H' MOVE 'OPCAO H ESCOLHIDA' TO T1MSGO
WHEN 'I' MOVE 'OPCAO I ESCOLHIDA' TO T1MSGO
WHEN 'J' MOVE 'OPCAO J ESCOLHIDA' TO T1MSGO
WHEN OTHER
MOVE 'OPCAO INVALIDA. TENTE NOVAMENTE'
TO T1MSGO
END-EVALUATE
PERFORM 999-TRATA-FASE2
.
*---------------------------------------------------------------*
220-PF3.
MOVE 'OBRIGADO POR UTILIZAR NOSSA TRANSACAO'
TO WS-MSG-ERRO
PERFORM 999-ENCERRA-TRANSACAO
.
*---------------------------------------------------------------*
230-PF5.
PERFORM 999-CHAMA-FASE1
.
*---------------------------------------------------------------*
240-ANYKEY.
MOVE 'TECLA INVALIDA - ESCOLHA UMA OPCAO VALIDA'
TO T1MSGO
PERFORM 999-TRATA-FASE2
.
*---------------------------------------------------------------*
999-MANDA-TELA.
MOVE EIBTRMID TO T1TERMO
MOVE EIBTRNID TO T1TRANO
MOVE EIBTASKN TO T1TASKO
MOVE WS-FASE TO T1FASEO
EXEC CICS ASSIGN
USERID(T1USRO)
END-EXEC
MOVE +18 TO WS-LENGTH
EXEC CICS LINK
PROGRAM('AUXCICS1')
COMMAREA(WS-VAR-TEMPO)
LENGTH(WS-LENGTH)
END-EXEC
MOVE WS-DATA TO T1DATAO
MOVE WS-HORARIO TO T1HORAO
EXEC CICS SEND
MAP('MAPAMNU')
MAPSET('AZ08MNU')
FROM(MAPAMNUO)
ERASE FREEKB ALARM CURSOR
END-EXEC
.
*---------------------------------------------------------------*
999-CHAMA-FASE1.
MOVE '1' TO WS-FASE
EXEC CICS RETURN
TRANSID('Z08M')
COMMAREA(WS-DFHCOMMAREA)
LENGTH(LENGTH OF WS-DFHCOMMAREA)
END-EXEC
.
*---------------------------------------------------------------*
999-CHAMA-FASE2.
MOVE '2' TO WS-FASE
EXEC CICS RETURN
TRANSID('Z08M')
COMMAREA(WS-DFHCOMMAREA)
LENGTH(LENGTH OF WS-DFHCOMMAREA)
END-EXEC
.
*---------------------------------------------------------------*
999-TRATA-FASE2.
MOVE -1 TO T1OPCL
MOVE DFHUNIMD TO T1OPCA
PERFORM 999-MANDA-TELA
PERFORM 999-CHAMA-FASE2
.
*---------------------------------------------------------------*
999-ENCERRA-TRANSACAO.
MOVE +80 TO WS-LENGTH
EXEC CICS SEND TEXT
FROM (WS-MSG-ERRO)
LENGTH(WS-LENGTH)
ERASE FREEKB ALARM
END-EXEC
EXEC CICS RETURN
END-EXEC
.
*---------------------------------------------------------------*
999-MAPFAIL.
MOVE 'ERRO NO MAPA AZ08MNU' TO WS-MSG-ERRO
PERFORM 999-ENCERRA-TRANSACAO
.
*---------------------------------------------------------------*
999-ERROR.
MOVE 'ERRO NAO PREVISTO' TO WS-MSG-ERRO
PERFORM 999-ENCERRA-TRANSACAO
.
*---------------------------------------------------------------*