*********************************************************************** 00000100
* PROGRAMA : EFND795 * 00000200
* PROGRAMADOR : FABRICA * 00000300
* ANALISTA : MAURICIO CARDEAL * 00000400
* * 00000500
* OBJETIVO : ALTERACAO DO CAD. CLIENTES COM SALDO E FLAG=9. * 00000600
* * 00000800
* DATA : 07/12/2007 * 00000900
*---------------------------------------------------------------------* 00001000
* ROTINAS UTILIZADAS: * 00001100
* * 00001200
*---------------------------------------------------------------------* 00001400
* ALTERACOES * 00001500
* SEQ AUTOR/MATR DATA DESCRICAO * 00001600
* 999 XXXXXXX/D999999 99/99/99 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.* 00001700
*---------------------------------------------------------------------* 00002300
00002400
**-------------------------------------------------------------------** 00002500
** ARQUIVO DE ENTRADA FNDD001E - ARQ. DE SALDOS ** 00002600
**-------------------------------------------------------------------** 00002700
00002800
FILE FNDD001E 00002900
D001E-SDO-CLI 010 006 P 00003000
00004500
**-------------------------------------------------------------------** 00004600
** ARQUIVO DE ENTRADA FNDD002I - VSAM - ARQ. DE CLIENTES ** 00004700
**-------------------------------------------------------------------** 00004800
00004900
FILE FNDD002I VS (UPDATE) 00005000
D002I-CHAVE 001 017 A 00005100
D002I-EMP 001 003 P 00005200
D002I-CLI 004 005 P 00005300
D002I-REG 009 002 P 00005310
D002I-SEQ 011 007 P 00005320
D002I-FLAG 067 001 N 00005330
00005500
**-------------------------------------------------------------------** 00006900
** AREAS AUXILIARES ** 00007000
**-------------------------------------------------------------------** 00007100
00007200
CHAVE W 017 A 00007300
CH-EMP CHAVE 003 P VALUE 1511 00007400
CH-CLIE CHAVE +03 005 P 00007500
CH-REG CHAVE +08 002 P VALUE 0 00007600
CH-SEQ CHAVE +10 007 P VALUE 0 00007700
00009500
CHAVE-R W 030 A 00009501
CH-EMP-R CHAVE-R 005 N 00009502
CH-CLIE-R CHAVE-R +05 009 N 00009503
CH-REG-R CHAVE-R +14 003 N 00009504
CH-SEQ-R CHAVE-R +17 013 N 00009505
00009506
WK-MASK W 005 P MASK 'ZZZ.ZZZ.ZZ9' 00009510
CT-ALTER W 005 P VALUE 0 00009511
00009520
**-------------------------------------------------------------------** 00009600
** PROCESSAMENTO INICIAL ** 00009700
**-------------------------------------------------------------------** 00009800
JOB INPUT NULL 00010000
00010100
GET FNDD001E 00010200
00010300
IF EOF FNDD001E 00010400
DISPLAY '**----------------------------------**' 00010500
DISPLAY '** **' 00010600
DISPLAY '** EFND795 - ARQUIVO FNDD001E VAZIO **' 00010700
DISPLAY '** **' 00010800
DISPLAY '**----------------------------------**' 00010900
DISPLAY ' ' 00011000
STOP EXECUTE 00011010
END-IF 00011100
00011200
STOP 00012500
00012600
**-------------------------------------------------------------------** 00012700
** PROCESSAMENTO REPETITIVO ** 00012800
**-------------------------------------------------------------------** 00012900
JOB INPUT FNDD001E FINISH FIM 00013100
00013400
CH-CLIE = D001E-SDO-CLI 00013410
00013420
READ FNDD002I KEY CHAVE STATUS 00013500
00013600
IF FNDD002I:FILE-STATUS NE 0 16 00013700
DISPLAY '**-----------------------------------------**' 00013710
DISPLAY '** **' 00013720
DISPLAY '** EFND795 - ERRO NO READ DO VSAM FNDD002I **' 00013730
CH-EMP-R = CH-EMP 00013731
CH-CLIE-R = CH-CLIE 00013732
CH-REG-R = CH-REG 00013733
CH-SEQ-R = CH-SEQ 00013734
DISPLAY '** CHAVE : ' CHAVE-R 00013735
DISPLAY '** FILE STATUS : ' FNDD002I:FILE-STATUS 00013740
DISPLAY '** **' 00013741
DISPLAY '**-----------------------------------------**' 00013750
DISPLAY ' ' 00013760
CALL ABEND USING 'S' 00013770
END-IF 00013780
00013790
IF FNDD002I:FILE-STATUS EQ 16 00013791
DISPLAY '**-------------------------------------------------**' 00013792
DISPLAY '** **' 00013793
DISPLAY '** EFND795 - CHAVE NAO ENCONTRADA NO VSAM FNDD002I **' 00013794
CH-EMP-R = CH-EMP 00013795
CH-CLIE-R = CH-CLIE 00013796
CH-REG-R = CH-REG 00013797
CH-SEQ-R = CH-SEQ 00013798
DISPLAY '** CHAVE : ' CHAVE-R 00013799
DISPLAY '** FILE STATUS : ' FNDD002I:FILE-STATUS 00013801
DISPLAY '** **' 00013802
DISPLAY '**-------------------------------------------------**' 00013803
DISPLAY ' ' 00013804
CALL ABEND USING 'S' 00013805
ELSE 00013806
PERFORM ATUALIZA-FNDD002I 00013807
END-IF 00013815
00018200
**-------------------------------------------------------------------** 00024400
** ROTINA DE ATUALIZACAO DO VSAM FNDD002I ** 00024500
**-------------------------------------------------------------------** 00024600
ATUALIZA-FNDD002I. PROC 00024700
00024800
IF D002I-FLAG EQ 9 00024801
D002I-FLAG = 0 00024802
WRITE FNDD002I UPDATE STATUS 00024803
IF FNDD002I:FILE-STATUS NE 0 00024804
DISPLAY '**------------------------------------------------**'00024805
DISPLAY '** **'00024806
DISPLAY '** EFND795 - ERRO NA ATUALIZACAO DO VSAM FNDD002I **'00024807
CH-EMP-R = CH-EMP 00024808
CH-CLIE-R = CH-CLIE 00024809
CH-REG-R = CH-REG 00024810
CH-SEQ-R = CH-SEQ 00024811
DISPLAY '** CHAVE : ' CHAVE-R 00024812
DISPLAY '** FILE STATUS : ' FNDD002I:FILE-STATUS 00024814
DISPLAY '** **'00024815
DISPLAY '**------------------------------------------------**'00024816
DISPLAY ' ' 00024817
CALL ABEND USING 'S' 00024818
END-IF 00024819
CT-ALTER = CT-ALTER + 1 00024820
END-IF 00024821
00024822
END-PROC 00024823
00024830
**-------------------------------------------------------------------** 00024900
** ROTINA DE FINALIZACAO ** 00025000
**-------------------------------------------------------------------** 00025100
FIM. PROC 00025200
00025300
DISPLAY '**----------------------------------------------**' 00025400
DISPLAY '** TOTAIS DE CONTROLE **' 00025500
DISPLAY '**----------------------------------------------**' 00025510
WK-MASK = FNDD001E:RECORD-COUNT 00025600
DISPLAY '** REGISTROS LIDOS FNDD001E : ' WK-MASK 00025700
WK-MASK = FNDD002I:RECORD-COUNT 00025710
DISPLAY '** REGISTROS LIDOS FNDD002I : ' WK-MASK 00025800
WK-MASK = CT-ALTER 00025810
DISPLAY '** REGISTROS ALTER FNDD002I : ' WK-MASK 00025900
DISPLAY '**----------------------------------------------**' 00026100
DISPLAY ' ' 00026200
00026300
END-PROC 00026400
00026500
Nenhum comentário:
Postar um comentário