Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Identification Division.
- Program-Id. BEM-DAT.
- Environment Division.
- special-names. decimal-point is comma.
- input-output section.
- file-control.
- select BEM assign to disk
- organization indexed
- access mode dynamic
- record key CODIGO-BEM
- alternate record key desc-BEM
- file status arqst-bem.
- select TIPOS assign to disk
- organization indexed
- access mode dynamic
- record key CODIGO-TIPO
- alternate record key DESCRICAO-TIPO
- file status arqst-tipos.
- data division.
- file section.
- fd BEM label record standard
- value of file-id is "BEM.dat".
- 01 reg-BEM.
- 02 codigo-BEM pic 9(04).
- 02 desc-BEM pic x(30).
- 02 DT-AQUISICAO pic 9(08).
- 02 cd-TIPO pic 9(04).
- 02 VALOR-COMPRA PIC 9(06)V99.
- 02 NOTA-FISCAL PIC 9(15).
- fd TIPOS label record standard
- value of file-id is "TIPOS.dat".
- 01 reg-TIPO.
- 02 CODIGO-TIPO pic 9(04).
- 02 DESCRICAO-TIPO pic x(30).
- working-storage section.
- 01 reg-BEM-e.
- 02 codigo-BEM-E pic 9(04).
- 02 desc-BEM-E pic x(30).
- 02 DT-AQUISICAO-E pic 9(08).
- 02 cd-TIPO-E pic 9(04).
- 02 VALOR-COMPRA-E PIC ZZZZZ,ZZ.
- 02 NOTA-FISCAL-E PIC 9(15).
- 01 reg-TIPO-e.
- 02 CODIGO-TIPO-E pic 9(04).
- 02 DESCRICAO-TIPO-E pic x(30).
- 01 data-sis.
- 02 ano pic 9999.
- 02 mes pic 99.
- 02 dia pic 99.
- 01 desmes.
- 02 filler pic x(10) value "Janeiro".
- 02 filler pic x(10) value "Fevereiro".
- 02 filler pic x(10) value "Mar‡o".
- 02 filler pic x(10) value "Abril".
- 02 filler pic x(10) value "Maio".
- 02 filler pic x(10) value "Junho".
- 02 filler pic x(10) value "Julho".
- 02 filler pic x(10) value "Agosto".
- 02 filler pic x(10) value "Setembro".
- 02 filler pic x(10) value "Outubro".
- 02 filler pic x(10) value "Novembro".
- 02 filler pic x(10) value "Dezembro".
- 01 tabela-meses redefines desmes.
- 02 mes-t pic x(10) occurs 12 times.
- 01 arqst-bem pic x(2).
- 01 arqst-tipos pic x(2).
- 01 op pic x(1) value spaces.
- 01 salva pic x(1) value spaces.
- 01 wigual pic 9 value zeros.
- 01 espaco pic x(60) value spaces.
- 01 op-continua pic x(1) value spaces.
- screen section.
- 01 tela1.
- 02 BLANK SCREEN.
- 02 line 02 col 5 value "Santos, de de .".
- 02 line 02 col 55 value "Nome da Empresa qota".
- 02 line 04 col 29 value "Controle de Patrimonio" highlight.
- 02 line 06 col 29 value "1. Inclusao de novos BENS".
- 02 line 08 col 29 value "2. Alteracao de BENS Cadastrados".
- 02 line 10 col 29 value "3. Exclusao de BENS Cadastrados".
- 02 line 12 col 29 value "4. Consulta por Codigo".
- 02 line 14 col 29 value "4. Consulta por DESCRIÇAO".
- 02 line 16 col 29 value "5. Retorno".
- 02 line 20 col 25 value "Escolha uma Opcao:".
- 01 tela2.
- 02 BLANK SCREEN.
- 02 line 02 col 05 value "Santos, de de .".
- 02 line 03 col 19 value "Codigo BEM: ".
- 02 line 04 col 19 value "Codigo tipo: ".
- 02 line 06 col 19 value "tipo do bem ".
- 02 line 08 col 19 value "Nome BEM: ".
- 02 line 10 col 19 value "Dta de aquisicao: ".
- 02 line 12 col 19 value "valor da compra: ".
- 02 line 14 col 19 value "nota fiscal: ".
- Procedure Division.
- Inicio.
- Perform abre-arq-bem.
- perform abre-arq-tipo.
- Perform abertura until op = "5".
- CLOSE TIPOS.
- CLOSE BEM.
- STOP run.
- abre-arq-tipo.
- open i-o TIPOS.
- if arqst-tipos not = "00"
- display "erro de abertura tipos" at 2155
- stop " "
- close TIPOS
- STOP RUN.
- abre-arq-bem.
- open i-o BEM.
- if arqst-bem not = "00"
- display "erro de abertura bem" at 2155
- close BEM
- open output BEM
- STOP RUN.
- abertura.
- display tela1.
- Perform mostra-data.
- accept op at 2045 WITH PROMPT AUTO.
- move spaces to op-continua
- evaluate op
- when "1"
- perform inclusao until op-continua = "n" or "N"
- when "2"
- perform alteracao until op-continua = "n" or "N"
- when "3"
- perform exclusao until op-continua = "n" or "N"
- when "4"
- perform consulta until op-continua = "n" or "N".
- mostra-data.
- move function current-date to data-sis.
- display dia at 0213.
- display mes-t(mes) at 0219.
- display ano at 0233.
- inclusao.
- perform tela-inclusao.
- move zeros to wigual.
- perform inicializar.
- perform testa-cod-bem until wigual = 1.
- perform recebe-dados.
- move zeros to wigual.
- perform testa-cod-tipo until wigual = 1.
- move CODIGO-TIPO to codigo-tipo-e.
- display codigo-tipo-e at 0642.
- perform grava.
- perform continua.
- tela-inclusao.
- display tela2.
- display "Cadastro de Locais" at 0430 with highlight.
- perform mostra-data.
- inicializar.
- move spaces to op op-continua salva.
- move spaces to DESCRICAO-TIPO-E desc-BEM-E.
- move zeros to cd-tipo-e codigo-bem-e codigo-tipo-e NOTA-FISCAL-E DT-AQUISICAO-E .
- move zeros to wigual.
- display espaco at 2315.
- recebe-dados.
- perform testa-desc-bem until desc-bem-e not = spaces.
- * perform testa-area-local until area-local-e not = zeros.
- testa-data-aq.
- accept DT-AQUISICAO-E at 1032.
- if DT-AQUISICAO-E = spaces then
- display "Digite a area do local." at 2321
- else
- display espaco at 2321.
- * fazer mostra tipo depto
- testa-cod-tipo.
- move 1 to wigual.
- move zeros to codigo-TIPO-E.
- accept codigo-TIPO-E at 0442 with prompt auto.
- if codigo-TIPO-E = zeros or spaces then
- display "Digite um codigo diferente de zero." at 2321
- set wigual to 0
- else
- move spaces to espaco.
- move codigo-TIPO-E to codigo-TIPO
- read TIPOS not invalid key move reg-TIPO to reg-TIPO-e
- move codigo-TIPO-E to cd-TIPO-E
- read TIPOS invalid key perform nao-cadastrado.
- nao-cadastrado.
- display "Departamento nao cadastrado" at 2321
- set wigual to 0.
- testa-cod-bem.
- move 1 to wigual.
- move zeros to codigo-BEM-E.
- accept codigo-BEM-E at 0332 with prompt auto.
- if codigo-BEM-E = zeros or spaces then
- display "Digite um codigo diferente de zero." at 2321
- set wigual to 0
- else
- move spaces to espaco.
- move codigo-BEM-E to codigo-BEM
- read BEM not invalid key perform ja-cadastrado.
- ja-cadastrado.
- display "Codigo ja cadastrado" at 2321
- set wigual to 0.
- testa-desc-bem.
- accept desc-BEM-E at 0832.
- if desc-BEM-E = spaces then
- display "Digite o nome do local." at 2321
- else
- display espaco at 2321.
- grava.
- display "Salvar <S/N> [ ]" at 2321.
- accept salva at 2335 with prompt auto.
- if salva = "S" or "s" then
- move reg-BEM-e to reg-BEM
- write reg-BEM
- if arqst-bem <> "00"
- display arqst-bem at 2221
- display arqst-tipos at 2321
- STOP " ".
- continua.
- display espaco at 2315.
- display "Continua <S/N> [ ]" at 2321.
- accept op-continua at 2337 with prompt auto.
- exclusao.
- perform inicializar.
- display erase at 0101.
- display tela2.
- display "Exclusao de bem" at 0430 with highlight.
- perform inicializar.
- perform le-dados.
- if arqst-bem = "00" then
- display "Deseja excluir o registro<S/N> [ ]" at 2319
- accept salva at 2351 with prompt auto
- else
- perform inicializar
- display espaco at 2319
- display "Registro nao encontrado." at 2321.
- if salva = "S" or "s" then
- display espaco at 2319
- Display "Registro apagado." at 2321
- delete BEM.
- stop " ".
- display espaco at 2315.
- perform continua.
- estuda-erro.
- display "Codigo nao encontrado." at 2321.
- stop " ".
- consulta.
- display erase at 0101.
- display tela2.
- display "Consulta de Registro" at 0430 with highlight.
- perform le-dados.
- perform continua.
- le-dados.
- perform inicializar.
- perform mostra-data.
- accept codigo-BEM-E at 0633.
- move codigo-BEM-E to codigo-BEM.
- read BEM key is codigo-BEM invalid key
- display "Local não encontrado" at 2320
- move 1 to wigual
- stop " ".
- if arqst-bem = "00" then
- display espaco at 2319
- perform mostra-tela.
- mostra-tela.
- move reg-BEM to reg-bem-e.
- move cd-TIPO-E to CODIGO-TIPO.
- read TIPOS key is codigo-tipo not invalid key move reg-tipo to reg-tipo-e.
- display codigo-BEM-E at 0333.
- display desc-BEM-E at 0833.
- display DT-AQUISICAO-E at 1033.
- display cd-TIPO-E at 0442.
- altera-dados.
- accept codigo-BEM-E at 0333 with prompt auto.
- accept desc-BEM-E at 0833.
- accept DT-AQUISICAO-E at 1033.
- perform testa-cod-tipo until wigual = 1.
- * move divisao-depto to divisao-depto-e.
- * display espaco at 1442.
- * display divisao-depto-e at 1442.
- alteracao.
- perform inicializar.
- display erase at 0101.
- display tela2.
- display "Alteracao de Registro" at 0425 with highlight.
- perform le-dados.
- if wigual <> 1
- perform altera-dados
- display "Deseja salvar alteracao <S/N> [ ]" at 2319
- accept salva at 2350 with prompt auto
- if salva = "S" or "s" then
- move reg-BEM-e to reg-BEM
- rewrite reg-BEM invalid key perform estuda-erro
- display espaco at 2315.
- perform continua.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement