Como podemos verificar e armazenar os espaços dos bancos Adabas e arquivos? O Adabas Mainframe tem um utilitário chamado ADAREP que nos mostra essas informações, o problema que o usuário tem que desenvolver uma rotina para fazer a gravação dessas informações em um file Adabas, este artigo foi desenvolvido para pegar essas informações do ADAREP, utilizando um programa Natural dos espaços do banco/files e gravar em um arquivo Adabas para posterior levantamento.
Telas de Monitoramento de Bancos/Arquivo
Tela do monitoramento dos bancos;
Tela do monitoramento de um file Adabas;
JCL
Este foi o JCL que foi criado (geralmente roda todo o dia primeiro do mês) é um ADAREP que roda e tem um programa Natural que faz um filtro para pegar informações para serem gravados em um arquivo Adabas;
AAB.DIBD.ADAPARM1(ADARE240
AAB.DIBD.ADAPARM1(ADARECPE
Programa Natural
Abaixo esta o programa Natural que faz o filtro das informações que queremos pegar - Muito obrigado amiga Katia Ueti pela força na criação desse programa e em tudo este processo, ela ajudou em toda a criação desse sistema;
View
Esta foi a view (file adabas) que vamos salvar as informações que tiramos do ADAREP
Duas observações do Programa Natural
Primeira observação, foi colocado para gravar no banco o tamanho em MB, insisti em colocar mais hoje vendo não acho tão necessario, pois usando os blocos dá para descobrir e fazer este calculo
Esse calculo da tabela abaixo;
Para calcular o devide 8391 vamos usar;
Esta formula;
DS tem 890219 de blocos do device 8391 o valor do DATA é 10796;
Segunda observação - nesta parte procuramos onde estão armazenados os espaços em blocos dos bancos;
Vai no ADAREP e procura esta parte e grava o numero de blocos usado do banco - se tiver mais DATAR1, DATAR2 ... tem que ser adicionado no programa;
Telas de Monitoramento de Bancos/Arquivo
Tela do monitoramento dos bancos;
MORE
PAG 1 01/02/21 14:45:57
DIA ASSO MB DATA MB ASSO CIL DATA CIL ASSO BLOC DATA BLOC
MES UTILIZ UTILIZ TOTAL TOTAL TOTAL TOTAL
--------- ------- ------- ----------- ----------- ----------- -----------
20210201 160.916 472.985 450.000 1.052.400 80.999.988 78.929.995
20210101 160.916 472.985 450.000 1.052.400 80.999.988 78.929.995
20201201 160.793 472.985 450.000 1.052.400 80.999.988 78.929.995
20201101 158.001 463.712 450.000 1.052.400 80.999.988 78.929.995
20201001 157.229 462.539 450.000 1.052.400 80.999.988 78.929.995
20200901 156.221 451.843 450.000 1.052.400 80.999.988 78.929.995
20200801 155.875 448.030 450.000 1.052.400 80.999.988 78.929.995
20200701 153.946 444.020 450.000 1.052.400 80.999.988 78.929.995
20200601 152.920 435.317 450.000 1.052.400 80.999.988 78.929.995
20200501 152.470 429.995 450.000 1.052.400 80.999.988 78.929.995
20200401 151.514 427.803 450.000 1.052.400 80.999.988 78.929.995
20200301 148.437 426.375 450.000 1.052.400 80.999.988 78.929.995
20200201 147.263 421.667 450.000 1.052.400 80.999.988 78.929.995
20200101 143.452 421.062 450.000 1.052.400 80.999.988 78.929.995
20191202 143.438 420.960 450.000 1.052.400 80.999.988 78.929.995
20191101 140.332 420.161 450.000 1.052.400 80.999.988 78.929.995
20191001 140.278 420.002 450.000 1.052.400 80.999.988 78.929.995
Tela do monitoramento de um file Adabas;
MORE
15:06:54 TAMANHO DOS FILES 01/02/21
DATA DATA BLOCO ASSO BLOCO DATA ESPACO ASSO ESPACO
MONITORAMENTO DISPONIVEL DISPONIVEL MB MB
------------- ------------ ------------ ----------- -----------
20191101 54570 66998 1.730 999
20191202 54558 66986 1.730 999
20191202 54558 66986 1.730 999
20200101 54550 66982 1.730 999
20200201 54541 66973 1.730 999
20200301 54535 66968 1.730 999
20200401 54528 66962 1.730 999
20200501 54525 66960 1.730 999
20200601 54519 66956 1.730 999
20200701 54510 66950 1.730 999
20200801 54498 66936 1.730 999
20200901 54489 66929 1.730 999
20201001 54480 66917 1.730 999
20201101 54472 66908 1.730 999
20201201 54463 66905 1.730 999
20210101 54457 66900 1.730 999
20210201 54451 66893 1.730 999
JCL
Este foi o JCL que foi criado (geralmente roda todo o dia primeiro do mês) é um ADAREP que roda e tem um programa Natural que faz um filtro para pegar informações para serem gravados em um arquivo Adabas;
MEMBER=AAFPCS01 000118 REC SAVE:01.12.2020 08:21 BY USERID AA01055 R=00000001
DSN=PROD.USER.JCLS LIB=PS VOL=PRL301 UNIT=1524
....+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
//AAFPCS01 JOB (AAF,DBA),'DBA',CLASS=S,MSGCLASS=A,USER=AASUB01
//*UQ ALLOW
//* ------------------------------------------------------------
//* MONITORAMENTO DO ESPACO DOS BANCOS E FILES ADABAS
//* GRAVA NO BANCO DE DADOS ADABAS - MONITORAMENTO DOS ESPACOS
//* ------------------------------------------------------------
//* PRIMEIRO STEP - ADAREP DO BANCO 240
//* ------------------------------------------------------------
//ADAR240 EXEC AAFAU240,REGION=0M
//DDDRUCK DD DSN=&&TEMP01,DISP=(NEW,PASS),SPACE=(CYL,50),UNIT=SYSDA,
// DCB=(LRECL=133,BLKSIZE=1330,RECFM=FBA)
//DDCARD DD DSN=AAB.DIBD.ADAPARM1(ADARE240),DISP=SHR
//DDKARTE DD DSN=AAB.DIBD.ADAPARM1(ADARECPE),DISP=SHR
//DDTEMPR1 DD DUMMY
//DDSORTR1 DD DUMMY
//DDSORTR2 DD DUMMY
//* ------------------------------------------------------------
//* GRAVANDO NO FILE 498 BANCO 240 AS INFORMACOES DO ADAREP
//* ------------------------------------------------------------
//NATP EXEC NATURAL,PARM1='SYS=P,MT=0,STACK=(LOG SUPORTE2)'
//CMWKF01 DD DSN=&&TEMP01,DISP=SHR
//CMWKF02 DD SYSOUT=G
//CMPRT01 DD SYSOUT=G,HOLD=YES
//SYSIN DD *
AAFPCS00
AAB.DIBD.ADAPARM1(ADARE240
MEMBER=ADARE240 000004 REC SAVE:17.12.2015 16:53 BY USERID AA01055 R=00000001
DSN=AAB.DIBD.ADAPARM1 VOL=PRL301 UNIT=1524
....+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
* -------------------------------------------------------------
* PARM - AAB.DIBD.ADAPARM1(ADARE240
* -------------------------------------------------------------
ADARUN PROG=ADAREP,DBID=240
AAB.DIBD.ADAPARM1(ADARECPE
MEMBER=ADARECPE 000004 REC SAVE:17.12.2015 16:54 BY USERID AA01055 R=00000001
DSN=AAB.DIBD.ADAPARM1 VOL=PRL301 UNIT=1524
....+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
* -------------------------------------------------------------
* PARM - AAB.DIBD.ADAPARM1(ADARECPE
* -------------------------------------------------------------
ADAREP CPEXLIST,NOFILE
Programa Natural
Abaixo esta o programa Natural que faz o filtro das informações que queremos pegar - Muito obrigado amiga Katia Ueti pela força na criação desse programa e em tudo este processo, ela ajudou em toda a criação desse sistema;
> > + Program AAFPCS00 Lib SUPORTE2
Top ....+....1....+....2....+....3....+....4....+....5....+....6....+....7..
0010 * ----------------------------------------------------------- *
0020 * FUNCAO: PEGAR ALGUMAS INFORMACOES DO ADAREP E GRAVAR *
0030 * NO FILE 498 DO DB 240 PARA MONITORAMENTO DO ESPACO *
0040 * UTILIZADO/DISPONIVEL DO BANCO E DOS FILES. *
0050 * ----------------------------------------------------------- *
0060 * AUTOR : KATIA UETI/CLAUDEMAR MARTINS *
0070 * CRIADO: 13/10/2015 *
0080 * ----------------------------------------------------------- *
0090 DEFINE DATA LOCAL
0100 01 #DATA-BASE-NUMBER (A133)
0110 01 REDEFINE #DATA-BASE-NUMBER
0120 02 #CAMPO-A-01 (A22)
0130 02 FILLER 10X
0140 02 #BANCO-ALFA (A03)
0150 02 REDEFINE #BANCO-ALFA
0160 03 #BANCO (N03)
0170 01 REDEFINE #DATA-BASE-NUMBER
0180 02 #CAMPO-A-02 (A16)
0190 02 #CAMPO-CYL-ALFA (A08)
0200 02 REDEFINE #CAMPO-CYL-ALFA
0210 03 #CAMPO-CYL (N08)
0220 02 FILLER 2X
0230 02 #BLOCO-TOTAL (A11)
0240 02 REDEFINE #BLOCO-TOTAL
0250 03 #BLOCO-NUM (N11)
0260 01 REDEFINE #DATA-BASE-NUMBER
0270 02 #CAMPO-A-03 (A31)
0280 01 REDEFINE #DATA-BASE-NUMBER
0290 02 FILLER 3X
0300 02 #NUM-FILE-ALFA (A04)
0310 02 REDEFINE #NUM-FILE-ALFA
0320 03 #NUM-FILE (N04)
0330 02 FILLER 1X
0340 02 #NOME-FILE (A16)
0350 02 FILLER 1X
0360 02 #NI-ALFA (A11)
0370 02 REDEFINE #NI-ALFA
0380 03 #NI (N11)
0390 02 FILLER 1X
0400 02 #UI-ALFA (A11)
0410 02 REDEFINE #UI-ALFA
0420 03 #UI (N11)
0430 02 FILLER 1X
0440 02 #AC-ALFA (A11)
0450 02 REDEFINE #AC-ALFA
0460 03 #AC (N11)
0470 02 FILLER 1X
0480 02 #DATA-ALFA (A11)
0490 02 REDEFINE #DATA-ALFA
0500 03 #DATA-FILE-ALLOC (N11)
0510 02 #WK-BARRA (A01)
0520 02 #DATA-CYL-ALFA (A11)
0530 01 REDEFINE #DATA-BASE-NUMBER
0540 02 #CAMPO-A-04 (A36)
0550 **
0560 01 #NUM-BANCO (N03)
0570 01 #QTD-BANCO (N03)
0580 01 #CONTROLA (A01)
0590 01 #CONTROLA2 (A01)
0600 01 #NUM-FILE-ANT (N04)
0610 01 #ASSOR-TOTAL (N20)
0620 01 #ASSOR-CYL-TOTAL (N20)
0630 01 #DATAR-TOTAL (N20)
0640 01 #DATAR-CYL-TOTAL (N20)
0650 01 #ASSOR-TOTAL-UNU (N20)
0660 01 #ASSOR-CYL-TOTAL-UNU (N20)
0670 01 #DATAR-TOTAL-UNU (N20)
0680 01 #DATAR-CYL-TOTAL-UNU (N20)
0690 01 #ASSO-FILE-ALLOC-UNU (N20)
0700 01 #NOME-FILE-BANCO (A16)
0710 01 #ASSO-TOTAL-ALLOC-FILE (N20)
0720 01 #DATA-TOTAL-ALLOC-FILE (N20)
0730 01 #DATA-CYL-TOTAL-ALLOC-FILE (N20)
0740 01 #ASSO-TOTAL-UNUSE-FILE (N20)
0750 01 #DATA-TOTAL-UNUSE-FILE (N20)
0760 01 #DATA-CYL-TOTAL-UNUSE-FILE (N20)
0770 01 #DATA-CYL (A11)
0780 01 REDEFINE #DATA-CYL
0790 02 #DATA-CYL-FILE-ALLOC (N11)
0800 * -----------------------------------------------------------
0810 01 MONITORAMENTO VIEW OF AAFU-MONITORAMENTO-BANCOS
0820 02 AAF-DATA-MONITORAMENTO
0830 02 AAF-BANCO
0840 02 AAF-NOME-FILE
0850 02 AAF-NUM-FILE
0860 02 AAF-TOTAL-FILES-CARREGADOS
0870 02 AAF-ASSOR-TOTAL
0880 02 AAF-DATAR-TOTAL
0890 02 AAF-DATA-CYL-TOTAL
0900 02 AAF-ASSO-CYL-TOTAL
0910 02 AAF-ASSOR-UNUSED
0920 02 AAF-DATAR-UNUSED
0930 02 AAF-DATA-CYL-UNUSED-TOTAL
0940 02 AAF-ASSO-CYL-UNUSED-TOTAL
0950 02 AAF-DATA-CYL-FILE-ALLOC
0960 02 AAF-DATA-FILE-ALLOC
0970 02 AAF-ASSO-FILE-ALLOC
0980 02 AAF-DATA-CYL-FILE-UNUSE
0990 02 AAF-DATA-FILE-UNUSE
1000 02 AAF-ASSO-FILE-UNUSE
1010 02 AAF-ASSO-TAMANHO-MB
1020 02 AAF-DATA-TAMANHO-MB
1030 02 AAF-ASSO-TAMANHO-MB-TOTAL
1040 02 AAF-DATA-TAMANHO-MB-TOTAL
1050 01 #ASSO-MB (N11)
1060 01 #DATA-MB (N11)
1070 01 #ASSO-MB-TOTAL (N11)
1080 01 #DATA-MB-TOTAL (N11)
1090 END-DEFINE
1100 **
1110 * -----------------------------------------------------------
1120 * GRAVANDO A DATA/HORA QUE FOI COLETADA A INFORMACAO
1130 * -----------------------------------------------------------
1140 **
1150 MOVE *DATN TO AAF-DATA-MONITORAMENTO
1160 **
1170 * -----------------------------------------------------------
1180 **
1190 READ WORK FILE 1 #DATA-BASE-NUMBER
1200 *
1210 * -----------------------------------------------------------
1220 **
1230 IF #CAMPO-A-01 EQ '1 '
1240 ESCAPE TOP
1250 END-IF
1260 **
1270 IF #CAMPO-A-04 EQ ' * Physical Layout of the Database *'
1280 #CONTROLA := ' '
1290 #CONTROLA2 := ' '
1300 MOVE #ASSOR-TOTAL TO AAF-ASSOR-TOTAL
1310 MOVE #DATAR-TOTAL TO AAF-DATAR-TOTAL
1320 MOVE #ASSOR-CYL-TOTAL TO AAF-ASSO-CYL-TOTAL
1330 MOVE #DATAR-CYL-TOTAL TO AAF-DATA-CYL-TOTAL
1340 MOVE #ASSOR-TOTAL-UNU TO AAF-ASSOR-UNUSED
1350 MOVE #DATAR-TOTAL-UNU TO AAF-DATAR-UNUSED
1360 MOVE #DATAR-CYL-TOTAL-UNU TO AAF-DATA-CYL-UNUSED-TOTAL
1370 MOVE #ASSOR-CYL-TOTAL-UNU TO AAF-ASSO-CYL-UNUSED-TOTAL
1380 MOVE #ASSO-TOTAL-UNUSE-FILE TO AAF-ASSO-FILE-UNUSE
1390 MOVE #DATA-TOTAL-UNUSE-FILE TO AAF-DATA-FILE-UNUSE
1400 MOVE #DATA-CYL-TOTAL-UNUSE-FILE TO AAF-DATA-CYL-FILE-UNUSE
1410 MOVE 'TOTALIZADOR' TO AAF-NOME-FILE
1420 MOVE AAF-DATAR-TOTAL TO AAF-DATA-FILE-ALLOC
1430 MOVE AAF-ASSOR-TOTAL TO AAF-ASSO-FILE-ALLOC
1440 MOVE #DATA-CYL-TOTAL-ALLOC-FILE TO AAF-DATA-CYL-FILE-ALLOC
1450 MOVE *DATN TO AAF-DATA-MONITORAMENTO
1460 MOVE #NUM-BANCO TO AAF-BANCO
1470 MOVE #QTD-BANCO TO AAF-TOTAL-FILES-CARREGADOS
1480 MOVE 999 TO AAF-NUM-FILE
1490 * -----------------------------------------------------------
1500 * TRANSFORMANDO BLOCOS EM MB - ESPACO UTILIZADO
1510 * -----------------------------------------------------------
1520 #ASSO-MB := 0
1530 #DATA-MB := 0
1540 #ASSO-MB := (AAF-ASSOR-UNUSED - AAF-ASSOR-TOTAL) * 4136 / 1024 / 1024
1550 #DATA-MB := (AAF-DATAR-UNUSED - AAF-DATAR-TOTAL) * 10796 / 1024 / 1024
1560 MOVE #ASSO-MB TO AAF-ASSO-TAMANHO-MB
1570 MOVE #DATA-MB TO AAF-DATA-TAMANHO-MB
1580 * -----------------------------------------------------------
1590 * TRANSFORMANDO BLOCOS EM MB - ESPACO TOTAL
1600 * -----------------------------------------------------------
1610 #ASSO-MB-TOTAL := 0
1620 #DATA-MB-TOTAL := 0
1630 #ASSO-MB-TOTAL := AAF-ASSOR-TOTAL * 4136 / 1024 / 1024
1640 #DATA-MB-TOTAL := AAF-DATAR-TOTAL * 10796 / 1024 / 1024
1650 MOVE #ASSO-MB-TOTAL TO AAF-ASSO-TAMANHO-MB-TOTAL
1660 MOVE #DATA-MB-TOTAL TO AAF-DATA-TAMANHO-MB-TOTAL
1670 * -----------------------------------------------------------
1680 STORE MONITORAMENTO
1690 END TRANSACTION
1700 ESCAPE BOTTOM
1710 END-IF
1720 **
1730 IF #CAMPO-A-01 EQ ' P H Y S I C A L L A'
1740 MOVE 'P' TO #CONTROLA
1750 #ASSOR-TOTAL := 0
1760 #DATAR-TOTAL := 0
1770 #CAMPO-A-02 := 0
1780 ESCAPE TOP
1790 END-IF
1800 **
1810 IF #CAMPO-A-01 EQ ' U N U S E D S T O R'
1820 MOVE 'U' TO #CONTROLA
1830 #ASSOR-TOTAL-UNU := 0
1840 #DATAR-TOTAL-UNU := 0
1850 ESCAPE TOP
1860 END-IF
1870 **
1880 IF #CAMPO-A-03 EQ ' File Name Alloc.:'
1890 MOVE 'A' TO #CONTROLA
1900 #ASSO-FILE-ALLOC-UNU := 0
1910 #NUM-FILE-ANT := 0
1920 ESCAPE TOP
1930 END-IF
1940 **
1950 IF #CONTROLA = 'A' AND #CONTROLA2 = 'X' AND #NUM-FILE-ALFA = '****'
1960 MOVE ' ' TO #CONTROLA
1970 MOVE ' ' TO #CONTROLA2
1980 ESCAPE TOP
1990 END-IF
2000 **
2010 * -----------------------------------------------------------
2020 * Gravando numero do banco
2030 * -----------------------------------------------------------
2040 **
2050 IF #CAMPO-A-01 EQ ' Data Base Number '
2060 MOVE #BANCO TO AAF-BANCO
2070 MOVE #BANCO TO #NUM-BANCO
2080 ESCAPE TOP
2090 END-IF
2100 * -----------------------------------------------------------
2110 * Gravando a quantidade de arquivos carregados
2120 * -----------------------------------------------------------
2130 IF #CAMPO-A-01 EQ ' Number of files loade'
2140 MOVE #BANCO TO AAF-TOTAL-FILES-CARREGADOS
2150 MOVE #BANCO TO #QTD-BANCO
2160 ESCAPE TOP
2170 END-IF
2180 * -----------------------------------------------------------
2190 * PEGANDO A QUANTIDADE DE ESPACO TOTAL - #CONTROLA = P
2200 * -----------------------------------------------------------
2210 IF #CONTROLA = 'P'
2220 IF #CONTROLA = 'P' AND #CAMPO-A-02 = ' ASSOR1 I 8391 I'
2230 #ASSOR-TOTAL := #ASSOR-TOTAL + #BLOCO-NUM
2240 MOVE #ASSOR-TOTAL TO AAF-ASSOR-TOTAL
2250 #ASSOR-CYL-TOTAL := #ASSOR-CYL-TOTAL + #CAMPO-CYL
2260 MOVE #ASSOR-CYL-TOTAL TO AAF-ASSO-CYL-TOTAL
2270 ESCAPE TOP
2280 END-IF
2290 * ----------------------------------------------------------------
2300 IF #CONTROLA = 'P' AND #CAMPO-A-02 = ' ASSOR2 I 8391 I'
2310 #ASSOR-TOTAL := #ASSOR-TOTAL + #BLOCO-NUM
2320 MOVE #ASSOR-TOTAL TO AAF-ASSOR-TOTAL
2330 #ASSOR-CYL-TOTAL := #ASSOR-CYL-TOTAL + #CAMPO-CYL
2340 MOVE #ASSOR-CYL-TOTAL TO AAF-ASSO-CYL-TOTAL
2350 ESCAPE TOP
2360 END-IF
2370 * ----------------------------------------------------------------
2380 IF #CONTROLA = 'P' AND #CAMPO-A-02 = ' ASSOR3 I 8391 I'
2390 #ASSOR-TOTAL := #ASSOR-TOTAL + #BLOCO-NUM
2400 MOVE #ASSOR-TOTAL TO AAF-ASSOR-TOTAL
2410 #ASSOR-CYL-TOTAL := #ASSOR-CYL-TOTAL + #CAMPO-CYL
2420 MOVE #ASSOR-CYL-TOTAL TO AAF-ASSO-CYL-TOTAL
2430 ESCAPE TOP
2440 END-IF
2450 * ----------------------------------------------------------------
2460 IF #CONTROLA = 'P' AND #CAMPO-A-02 = ' DATAR1 I 8391 I'
2470 #DATAR-TOTAL := #DATAR-TOTAL + #BLOCO-NUM
2480 MOVE #DATAR-TOTAL TO AAF-DATAR-TOTAL
2490 #DATAR-CYL-TOTAL := #DATAR-CYL-TOTAL + #CAMPO-CYL
2500 MOVE #DATAR-CYL-TOTAL TO AAF-DATA-CYL-TOTAL
2510 ESCAPE TOP
2520 END-IF
2530 * ----------------------------------------------------------------
2540 IF #CONTROLA = 'P' AND #CAMPO-A-02 = ' DATAR2 I 8391 I'
2550 #DATAR-TOTAL := #DATAR-TOTAL + #BLOCO-NUM
2560 MOVE #DATAR-TOTAL TO AAF-DATAR-TOTAL
2570 #DATAR-CYL-TOTAL := #DATAR-CYL-TOTAL + #CAMPO-CYL
2580 MOVE #DATAR-CYL-TOTAL TO AAF-DATA-CYL-TOTAL
2590 ESCAPE TOP
2600 END-IF
2610 * ----------------------------------------------------------------
2620 IF #CONTROLA = 'P' AND #CAMPO-A-02 = ' DATAR3 I 8391 I'
2630 #DATAR-TOTAL := #DATAR-TOTAL + #BLOCO-NUM
2640 MOVE #DATAR-TOTAL TO AAF-DATAR-TOTAL
2650 #DATAR-CYL-TOTAL := #DATAR-CYL-TOTAL + #CAMPO-CYL
2660 MOVE #DATAR-CYL-TOTAL TO AAF-DATA-CYL-TOTAL
2670 ESCAPE TOP
2680 END-IF
2690 * ----------------------------------------------------------------
2700 END-IF /* (2210)
2710 **
2720 * -----------------------------------------------------------
2730 * PEGANDO A QUANTIDADE DE ESPACO - unused - MOVENDO U
2740 * -----------------------------------------------------------
2750 **
2760 IF #CONTROLA = 'U'
2770 IF #CONTROLA = 'U' AND #CAMPO-A-02 = ' ASSOR1 I 8391 I'
2780 #ASSOR-TOTAL-UNU := #ASSOR-TOTAL-UNU + #BLOCO-NUM
2790 MOVE #ASSOR-TOTAL-UNU TO AAF-ASSOR-UNUSED
2800 #ASSOR-CYL-TOTAL-UNU := #ASSOR-CYL-TOTAL-UNU + #CAMPO-CYL
2810 MOVE #ASSOR-CYL-TOTAL-UNU TO AAF-ASSO-CYL-UNUSED-TOTAL
2820 ESCAPE TOP
2830 END-IF
2840 **
2850 IF #CONTROLA = 'U' AND #CAMPO-A-02 = ' ASSOR2 I 8391 I'
2860 #ASSOR-TOTAL-UNU := #ASSOR-TOTAL-UNU + #BLOCO-NUM
2870 MOVE #ASSOR-TOTAL-UNU TO AAF-ASSOR-UNUSED
2880 #ASSOR-CYL-TOTAL-UNU := #ASSOR-CYL-TOTAL-UNU + #CAMPO-CYL
2890 MOVE #ASSOR-CYL-TOTAL-UNU TO AAF-ASSO-CYL-UNUSED-TOTAL
2900 ESCAPE TOP
2910 END-IF
2920 **
2930 IF #CONTROLA = 'U' AND #CAMPO-A-02 = ' ASSOR3 I 8391 I'
2940 #ASSOR-TOTAL-UNU := #ASSOR-TOTAL-UNU + #BLOCO-NUM
2950 MOVE #ASSOR-TOTAL-UNU TO AAF-ASSOR-UNUSED
2960 #ASSOR-CYL-TOTAL-UNU := #ASSOR-CYL-TOTAL-UNU + #CAMPO-CYL
2970 MOVE #ASSOR-CYL-TOTAL-UNU TO AAF-ASSO-CYL-UNUSED-TOTAL
2980 ESCAPE TOP
2990 END-IF
3000 **
3010 IF #CONTROLA = 'U' AND #CAMPO-A-02 = ' DATAR1 I 8391 I'
3020 #DATAR-TOTAL-UNU := #DATAR-TOTAL-UNU + #BLOCO-NUM
3030 MOVE #DATAR-TOTAL-UNU TO AAF-DATAR-UNUSED
3040 #DATAR-CYL-TOTAL-UNU := #DATAR-CYL-TOTAL-UNU + #CAMPO-CYL
3050 MOVE #DATAR-CYL-TOTAL-UNU TO AAF-DATA-CYL-UNUSED-TOTAL
3060 ESCAPE TOP
3070 END-IF
3080 *
3090 IF #CONTROLA = 'U' AND #CAMPO-A-02 = ' DATAR2 I 8391 I'
3100 #DATAR-TOTAL-UNU := #DATAR-TOTAL-UNU + #BLOCO-NUM
3110 MOVE #DATAR-TOTAL-UNU TO AAF-DATAR-UNUSED
3120 #DATAR-CYL-TOTAL-UNU := #DATAR-CYL-TOTAL-UNU + #CAMPO-CYL
3130 MOVE #DATAR-CYL-TOTAL-UNU TO AAF-DATA-CYL-UNUSED-TOTAL
3140 ESCAPE TOP
3150 END-IF
3160 *
3170 IF #CONTROLA = 'U' AND #CAMPO-A-02 = ' DATAR3 I 8391 I'
3180 #DATAR-TOTAL-UNU := #DATAR-TOTAL-UNU + #BLOCO-NUM
3190 MOVE #DATAR-TOTAL-UNU TO AAF-DATAR-UNUSED
3200 #DATAR-CYL-TOTAL-UNU := #DATAR-CYL-TOTAL-UNU + #CAMPO-CYL
3210 MOVE #DATAR-CYL-TOTAL-UNU TO AAF-DATA-CYL-UNUSED-TOTAL
3220 ESCAPE TOP
3230 END-IF
3240 *
3250 END-IF /* (2770)
3260 **
3270 * -----------------------------------------------------------
3280 * PEGANDO A QUANTIDADE DE ESPACO POR ARQUIVO - MOVENDO A
3290 * -----------------------------------------------------------
3300 **
3310 IF #CONTROLA = 'A'
3320 IF #CONTROLA = 'A'
3330 AND #NUM-FILE = 7
3340 AND #NOME-FILE = 'AAF-CCORD-DIC'
3350 * -----------------------------------------------------------
3360 * 17/12/15 - ALTERADO ACIMA O #NUM-FILE/#NOME-FILE POIS O
3370 * FILE 4 SO TEM NO BANCO 240 O FILE 7 TEM EM TODOS OS BANCOS
3380 * DAVA ERRO AO GERAR RODAR NOS OUTROS BANCOS POIS O FILE 4
3390 * NAO ESTAVA CRIADO NOS OUTROS BANCOS.
3400 * -----------------------------------------------------------
3410 MOVE 'X' TO #CONTROLA2
3420 MOVE #NUM-FILE TO #NUM-FILE-ANT
3430 MOVE #NUM-FILE TO AAF-NUM-FILE
3440 #ASSO-FILE-ALLOC-UNU := #UI + #NI + #AC
3450 MOVE #NOME-FILE TO #NOME-FILE-BANCO
3460 MOVE RIGHT #DATA-CYL-ALFA TO #DATA-CYL
3470 MOVE #DATA-CYL-FILE-ALLOC TO AAF-DATA-CYL-FILE-ALLOC
3480 MOVE #DATA-FILE-ALLOC TO AAF-DATA-FILE-ALLOC
3490 MOVE #ASSO-FILE-ALLOC-UNU TO AAF-ASSO-FILE-ALLOC
3500 MOVE #NOME-FILE TO AAF-NOME-FILE
3510 #ASSO-TOTAL-ALLOC-FILE := #ASSO-TOTAL-ALLOC-FILE +
3520 #ASSO-FILE-ALLOC-UNU
3530 #DATA-TOTAL-ALLOC-FILE := #DATA-TOTAL-ALLOC-FILE +
3540 #DATA-FILE-ALLOC
3550 #DATA-CYL-TOTAL-ALLOC-FILE := #DATA-CYL-TOTAL-ALLOC-FILE +
3560 #DATA-CYL-FILE-ALLOC
3570 * -----------------------------------------------------------
3580 * TRANSFORMANDO BLOCOS EM MB
3590 * -----------------------------------------------------------
3600 #ASSO-MB := 0
3610 #DATA-MB := 0
3620 *
3630 * AAF-DATA-FILE-UNUSE
3640 * AAF-ASSO-FILE-UNUSE
3650 *
3660 #ASSO-MB := #ASSO-FILE-ALLOC-UNU * 4136 / 1024 / 1024
3670 #DATA-MB := #DATA-FILE-ALLOC * 10796 / 1024 / 1024
3680 MOVE #ASSO-MB TO AAF-ASSO-TAMANHO-MB
3690 MOVE #DATA-MB TO AAF-DATA-TAMANHO-MB
3700 * -----------------------------------------------------------
3710 ESCAPE TOP
3720 END-IF
3730 **
3740 IF #CONTROLA = 'A' AND #CONTROLA2 = 'X'
3750 IF #NUM-FILE-ANT NE #NUM-FILE
3760 #NUM-FILE-ANT := #NUM-FILE
3770 #ASSO-FILE-ALLOC-UNU := #UI + #NI + #AC
3780 MOVE RIGHT #DATA-CYL-ALFA TO #DATA-CYL
3790 MOVE #DATA-CYL-FILE-ALLOC TO AAF-DATA-CYL-FILE-ALLOC
3800 MOVE #DATA-FILE-ALLOC TO AAF-DATA-FILE-ALLOC
3810 MOVE #ASSO-FILE-ALLOC-UNU TO AAF-ASSO-FILE-ALLOC
3820 MOVE #NUM-FILE TO AAF-NUM-FILE
3830 MOVE #NOME-FILE TO AAF-NOME-FILE
3840 #ASSO-TOTAL-ALLOC-FILE := #ASSO-TOTAL-ALLOC-FILE +
3850 #ASSO-FILE-ALLOC-UNU
3860 #DATA-TOTAL-ALLOC-FILE := #DATA-TOTAL-ALLOC-FILE +
3870 #DATA-FILE-ALLOC
3880 #DATA-CYL-TOTAL-ALLOC-FILE := #DATA-CYL-TOTAL-ALLOC-FILE +
3890 #DATA-CYL-FILE-ALLOC
3900 * -----------------------------------------------------------
3910 * TRANSFORMANDO BLOCOS EM MB
3920 * -----------------------------------------------------------
3930 #ASSO-MB := #ASSO-FILE-ALLOC-UNU * 4136 / 1024 / 1024
3940 #DATA-MB := #DATA-FILE-ALLOC * 10796 / 1024 / 1024
3950 MOVE #ASSO-MB TO AAF-ASSO-TAMANHO-MB
3960 MOVE #DATA-MB TO AAF-DATA-TAMANHO-MB
3970 * -----------------------------------------------------------
3980 ESCAPE TOP
3990 END-IF
4000 END-IF
4010 **
4020 IF #CONTROLA = 'A' AND #CONTROLA2 = 'X' AND
4030 #NOME-FILE = ' ' AND
4040 #NUM-FILE-ANT = #NUM-FILE
4050 #ASSO-FILE-ALLOC-UNU := #UI + #NI + #AC
4060 MOVE RIGHT #DATA-CYL-ALFA TO #DATA-CYL
4070 MOVE #DATA-CYL-FILE-ALLOC TO AAF-DATA-CYL-FILE-UNUSE
4080 MOVE #DATA-FILE-ALLOC TO AAF-DATA-FILE-UNUSE
4090 MOVE #ASSO-FILE-ALLOC-UNU TO AAF-ASSO-FILE-UNUSE
4100 #ASSO-TOTAL-UNUSE-FILE := #ASSO-TOTAL-UNUSE-FILE +
4110 #ASSO-FILE-ALLOC-UNU
4120 #DATA-TOTAL-UNUSE-FILE := #DATA-TOTAL-UNUSE-FILE +
4130 #DATA-FILE-ALLOC
4140 #DATA-CYL-TOTAL-UNUSE-FILE := #DATA-CYL-TOTAL-UNUSE-FILE +
4150 #DATA-CYL-FILE-ALLOC
4160 STORE MONITORAMENTO
4170 END TRANSACTION
4180 ESCAPE TOP
4190 END-IF
4200 END-IF /* (3480)
4210 END-WORK
4220 END
....+....1....+....2....+....3....+....4....+....5....+... S 422 L 403
View
Esta foi a view (file adabas) que vamos salvar as informações que tiramos do ADAREP
13:21:22 ***** NATURAL LIST COMMAND ***** 30/01/2021
User AA01055 - List DDM AAFU-MONITORAMENTO-BANCOS - Library SUPORTE2
DDM DBID 0 DDM FNR 498 VSAM Name Default Sequence Page 1
T L DB Name F Leng S D Remark
- - -- -------------------------------- - ---- - - ------------------------
* Generation started
* at 2017-06-05 15:12:51
* by user AA01055
*
1 AA AAF-DATA-MONITORAMENTO N 8,0 N D
1 AB AAF-BANCO N 3,0 N D
1 AC AAF-TOTAL-FILES-CARREGADOS N 3,0 N
1 AD AAF-ASSOR-TOTAL N 11,0 N
1 AE AAF-DATAR-TOTAL N 11,0 N
1 AH AAF-DATA-CYL-TOTAL N 11,0 N
1 AI AAF-ASSO-CYL-TOTAL N 11,0 N
1 AF AAF-ASSOR-UNUSED N 11,0 N
1 AG AAF-DATAR-UNUSED N 11,0 N
1 AP AAF-DATA-CYL-UNUSED-TOTAL N 20,0 N
1 AS AAF-ASSO-CYL-UNUSED-TOTAL N 20,0 N
1 AJ AAF-NOME-FILE A 16 N D
1 AK AAF-NUM-FILE N 3,0 N D
1 AL AAF-DATA-CYL-FILE-ALLOC N 11,0 N
1 AM AAF-DATA-CYL-FILE-UNUSE N 11,0 N
1 AN AAF-DATA-FILE-ALLOC N 11,0 N
1 AO AAF-ASSO-FILE-ALLOC N 11,0 N
1 AQ AAF-DATA-FILE-UNUSE N 11,0 N
1 AR AAF-ASSO-FILE-UNUSE N 11,0 N
1 AT AAF-ASSO-TAMANHO-MB N 11,0 N
1 AU AAF-DATA-TAMANHO-MB N 11,0 N
1 AV AAF-ASSO-TAMANHO-MB-TOTAL N 11,0 N
1 AW AAF-DATA-TAMANHO-MB-TOTAL N 11,0 N
* *
1 S1 AAF-SUPER-BANCO-DATA B 11 N S
* -------- SOURCE FIELD(S) -------
* AAF-BANCO(1-3)
* AAF-DATA-MONITORAMENTO(1-8)
1 S2 AAF-SUPER-BANCO-FILE-DATA B 14 N S
* -------- SOURCE FIELD(S) -------
* AAF-BANCO(1-3)
* AAF-NUM-FILE(1-3)
* AAF-DATA-MONITORAMENTO(1-8)
End of List.
Command ===>
Enter-PF1---PF2---PF3---PF4---PF5---PF6---PF7---PF8---PF9---PF10--PF11--PF12---
Help Print Exit Short -- - + ++ Canc
Duas observações do Programa Natural
Primeira observação, foi colocado para gravar no banco o tamanho em MB, insisti em colocar mais hoje vendo não acho tão necessario, pois usando os blocos dá para descobrir e fazer este calculo
1540 #ASSO-MB := (AAF-ASSOR-UNUSED - AAF-ASSOR-TOTAL) * 4136 / 1024 / 1024
1550 #DATA-MB := (AAF-DATAR-UNUSED - AAF-DATAR-TOTAL) * 10796 / 1024 / 1024
1630 #ASSO-MB-TOTAL := AAF-ASSOR-TOTAL * 4136 / 1024 / 1024
1640 #DATA-MB-TOTAL := AAF-DATAR-TOTAL * 10796 / 1024 / 1024
3660 #ASSO-MB := #ASSO-FILE-ALLOC-UNU * 4136 / 1024 / 1024
3670 #DATA-MB := #DATA-FILE-ALLOC * 10796 / 1024 / 1024
3930 #ASSO-MB := #ASSO-FILE-ALLOC-UNU * 4136 / 1024 / 1024
3940 #DATA-MB := #DATA-FILE-ALLOC * 10796 / 1024 / 1024
Esse calculo da tabela abaixo;
+--------+----------+-----------+-----------+-----------+-----------+-----------+----------------+-------+
| Device | Trks/Cyl | ASSO | DATA | WORK | PLOG/RLOG | CLOG | TEMP/SORT/DSIM | Notes |
+--------+----------+-----------+-----------+-----------+-----------+-----------+----------------+-------+
| 0512 | 16 | 2044:8 | 4092:4 | 8192:2 | 8192:2 | 8192:2 | 8192:2 | |
+--------+----------+-----------+-----------+-----------+-----------+-----------+----------------+-------+
| 3310 | 11 | 2044:8 | 4092:4 | 4096:4 | 4096:4 | 4096:4 | 8192:2 | |
+--------+----------+-----------+-----------+-----------+-----------+-----------+----------------+-------+
| 3330 | 19 | 1510:8 | 3140:4 | 4252:3 | 4252:3 | 3156:4 | 3140:4 | |
+--------+----------+-----------+-----------+-----------+-----------+-----------+----------------+-------+
| 3340 | 12 | 1255:6 | 2678:3 | 3516:2 | 3516:2 | 3516:2 | 3500:2 | |
+--------+----------+-----------+-----------+-----------+-----------+-----------+----------------+-------+
| 3350 | 30 | 1564:11 | 3008:6 | 4628:4 | 4628:4 | 3024:6 | 3008:6 | |
+--------+----------+-----------+-----------+-----------+-----------+-----------+----------------+-------+
| 3370 | 12 | 2044:15 | 3068:10 | 5120:6 | 5120:6 | 3072:10 | 7680:4 | |
+--------+----------+-----------+-----------+-----------+-----------+-----------+----------------+-------+
| 3375 | 12 | 2016:15 | 4092:8 | 4096:8 | 4096:8 | 4096:8 | 8608:4 | |
+--------+----------+-----------+-----------+-----------+-----------+-----------+----------------+-------+
| 3380 | 15 | 2004:19 | 4820:9 | 5492:8 | 5492:8 | 4820:9 | 7476:6 | 3 |
+--------+----------+-----------+-----------+-----------+-----------+-----------+----------------+-------+
| 3390 | 15 | 2544:18 | 5064:10 | 5724:9 | 5724:9 | 5064:10 | 8904:6 | 3 |
+--------+----------+-----------+-----------+-----------+-----------+-----------+----------------+-------+
| 8345 | 15 | 4092:10 | 22780:2 | 22920:2 | 22920:2 | 22920:2 | 22920:2 | |
+--------+----------+-----------+-----------+-----------+-----------+-----------+----------------+-------+
| 8350 | 30 | 3008:6 | 6232:3 | 9442:2 | 9442:2 | 9442:2 | 9442:2 | 1 |
+--------+----------+-----------+-----------+-----------+-----------+-----------+----------------+-------+
| 8380 | 15 | 3476:12 | 6356:7 | 9076:5 | 9076:5 | 9076:5 | 9076:5 | 1 |
+--------+----------+-----------+-----------+-----------+-----------+-----------+----------------+-------+
| 8381 | 15 | 3476:12 | 9076:5 | 11476:4 | 11476:4 | 9076:5 | 9076:5 | 1 |
+--------+----------+-----------+-----------+-----------+-----------+-----------+----------------+-------+
| 8385 | 15 | 4092:10 | 23292:2 | 23468:2 | 23468:2 | 23468:2 | 23468:2 | 1 |
+--------+----------+-----------+-----------+-----------+-----------+-----------+----------------+-------+
| 8390 | 15 | 3440:14 | 6518:8 | 10706:5 | 10706:5 | 8904:6 | 8904:6 | 1 |
+--------+----------+-----------+-----------+-----------+-----------+-----------+----------------+-------+
| 8391 | 15 | 4136:12 | 10796:5 | 13682:4 | 13682:4 | 8904:6 | 18452:3 | 1 |
+--------+----------+-----------+-----------+-----------+-----------+-----------+----------------+-------+
| 8392 | 15 | 4092:12 | 12796:4 | 18452:3 | 18452:3 | 18452:3 | 18452:3 | 1 |
+--------+----------+-----------+-----------+-----------+-----------+-----------+----------------+-------+
| 8393 | 15 | 4092:12 | 27644:2 | 27990:2 | 27990:2 | 27990:2 | 27990:2 | 1 |
+--------+----------+-----------+-----------+-----------+-----------+-----------+----------------+-------+
| 9332 | 6 | 2044:10 | 4092:5 | 5120:4 | 5120:4 | 10240:2 | 10240:2 | 2 |
+--------+----------+-----------+-----------+-----------+-----------+-----------+----------------+-------+
| 9335 | 6 | 2556:14 | 3580:10 | 5120:7 | 5120:7 | 7168:5 | 7168:5 | |
+--------+----------+-----------+-----------+-----------+-----------+-----------+----------------+-------+
| 9345 | 15 | 4092:10 | 7164:6 | 11148:4 | 11148:4 | 22920:2 | 22920:2 | 3 |
+--------+----------+-----------+-----------+-----------+-----------+-----------+----------------+-------+
Para calcular o devide 8391 vamos usar;
+--------+----------+-----------+-----------+-----------+-----------+-----------+----------------+-------+
| Device | Trks/Cyl | ASSO | DATA | WORK | PLOG/RLOG | CLOG | TEMP/SORT/DSIM | Notes |
+--------+----------+-----------+-----------+-----------+-----------+-----------+----------------+-------+
| 8391 | 15 | 4136:12 | 10796:5 | 13682:4 | 13682:4 | 8904:6 | 18452:3 | 1 |
+--------+----------+-----------+-----------+-----------+-----------+-----------+----------------+-------+
Esta formula;
Bloco x Device_And_File_Considerations = Tamanho_em_Bytes
Tamanho_em_Bytes / 1024 = Tamanho_em_Kb
Tamanho_em_Kb / 1024 = Tamanho_em_Mb
Tamanho_em_Mb / 1024 = Tamanho_em_Gb
DS tem 890219 de blocos do device 8391 o valor do DATA é 10796;
890219 x 10796 = 9610804324 (9.610.804.324 bytes)
9610804324 / 1024 = 9385551,09765625 (9.385.551 Kb)
9385087 / 1024 = 9165,577243804932 (9.165 Mb)
9165 / 1024 = 8,950759027153254 (8.9501953125 Gb)
Segunda observação - nesta parte procuramos onde estão armazenados os espaços em blocos dos bancos;
2220 IF #CONTROLA = 'P' AND #CAMPO-A-02 = ' ASSOR1 I 8391 I'
2300 IF #CONTROLA = 'P' AND #CAMPO-A-02 = ' ASSOR2 I 8391 I'
2380 IF #CONTROLA = 'P' AND #CAMPO-A-02 = ' ASSOR3 I 8391 I'
2460 IF #CONTROLA = 'P' AND #CAMPO-A-02 = ' DATAR1 I 8391 I'
2540 IF #CONTROLA = 'P' AND #CAMPO-A-02 = ' DATAR2 I 8391 I'
2620 IF #CONTROLA = 'P' AND #CAMPO-A-02 = ' DATAR3 I 8391 I'
2770 IF #CONTROLA = 'U' AND #CAMPO-A-02 = ' ASSOR1 I 8391 I'
2850 IF #CONTROLA = 'U' AND #CAMPO-A-02 = ' ASSOR2 I 8391 I'
2930 IF #CONTROLA = 'U' AND #CAMPO-A-02 = ' ASSOR3 I 8391 I'
3010 IF #CONTROLA = 'U' AND #CAMPO-A-02 = ' DATAR1 I 8391 I'
3090 IF #CONTROLA = 'U' AND #CAMPO-A-02 = ' DATAR2 I 8391 I'
3170 IF #CONTROLA = 'U' AND #CAMPO-A-02 = ' DATAR3 I 8391 I'
Vai no ADAREP e procura esta parte e grava o numero de blocos usado do banco - se tiver mais DATAR1, DATAR2 ... tem que ser adicionado no programa;
P H Y S I C A L L A Y O U T
DD- I Dev I Nmbr of I Nmbr of Extents in Blk. I Block I Nmbr of I
Names I Type I Cyls I Blocks From To I Lngth I M-Byte I
I I I I I I
-------I------I---------I----------------------------------I-------I----------I
I I I I I I
ASSOR1 I 8391 I 150000 I 26999988 1 26999988 I 4136 I 106498 I
ASSOR2 I 8391 I 150000 I 27000000 26999989 53999988 I 4136 I 106498 I
ASSOR3 I 8391 I 150000 I 27000000 53999989 80999988 I 4136 I 106498 I
I I I I I I
DATAR1 I 8391 I 350800 I 26309995 1 26309995 I 10796 I 270884 I
DATAR2 I 8391 I 350800 I 26310000 26309996 52619995 I 10796 I 270884 I
DATAR3 I 8391 I 350800 I 26310000 52619996 78929995 I 10796 I 270884 I
I I I I I I
WORKR1 I 8391 I 750 I 44996 1 44996 I 13682 I 587 I
I I I I I I
0 comentários:
Enviar um comentário