Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- IDENTIFICATION DIVISION.
- *=======================*
- PROGRAM-ID. FTCOB006.
- *AUTHOR. TUTORFREE.
- *DATE-WRITTEN. 15/03/2016.
- *--------------------------------------------------------------*
- * DISCIPLINA PROGRAMACAO MAINFRAME
- *--------------------------------------------------------------*
- * OBJETIVO: RECEBER DADOS DA SYSIN(ACCEPT)
- * LER 20 REGISTRO A PARTIR DA SYSIN
- *--------------------------------------------------------------*
- *------------------> HISTORICO - MANUTENCAO <------------------*
- * VERSAO MES/ANO NR.DOC IDENT. DESCRICAO
- * ------ ------- ------ ------ ------------------------- *
- * V01 MAR/2016 010001 SISTEMA MOSTRA SYSOUT
- *--------------------------------------------------------------*
- ENVIRONMENT DIVISION.
- *====================*
- CONFIGURATION SECTION.
- *---------------------*
- SPECIAL-NAMES.
- DECIMAL-POINT IS COMMA
- CURRENCY SIGN IS "R$ " WITH PICTURE SYMBOL "$"
- .
- INPUT-OUTPUT SECTION.
- *---------------------*
- DATA DIVISION.
- *=============*
- FILE SECTION.
- *------------*
- WORKING-STORAGE SECTION.
- *-----------------------*
- 01 FILLER PIC X(35) VALUE
- '**** INICIO DA WORKING-STORAGE ****'.
- *-----> VARIAVEIS AUXILIARES UTILIZADA NO PROCESSAMENTO
- 01 WS-AREA-AUX.
- 05 WS-FIM PIC X(01).
- 05 WS-CTLIDO PIC 9(02).
- 05 WS-MEDIA PIC 9(02)V99.
- *-----> ENTRADA - DADOS VIA SYSIN (NO JCL DE EXECUCAO)
- 01 WS-REG-SYSIN.
- 05 WS-NOME-IN PIC X(20).
- 05 WS-NOTA1-IN PIC 9(02)V99.
- 05 WS-NOTA2-IN PIC 9(02)V99.
- 01 FILLER PIC X(20) VALUE
- ' LISTA DE NOTAS '.
- 01 FILLER PIC X(35) VALUE
- '****** FIM DA WORKING-STORAGE *****'.
- *-----> SAIDA - SYSOUT DAS NOTAS
- 01 WS-DETALHE.
- 05 FILLER PIC X(02) VALUE SPACE.
- 05 WS-DET-NOME PIC X(20) VALUE SPACE.
- 05 FILLER PIC X(05) VALUE SPACE.
- 05 WS-DET-NT1 PIC Z9,99.
- 05 FILLER PIC X(05) VALUE SPACE.
- 05 WS-DET-NT2 PIC Z9,99.
- 05 FILLER PIC X(05) VALUE SPACE.
- 05 WS-DET-MEDIA PIC Z9,99.
- 01 FILLER PIC X(20) VALUE
- ' LISTA DE NOTAS '.
- *
- PROCEDURE DIVISION.
- *==================*
- *--------------------------------------------------------------*
- * PROCESSO PRINCIPAL
- *--------------------------------------------------------------*
- 000-RSPRG002.
- PERFORM 010-INICIAR
- PERFORM 030-PROCESSAR UNTIL WS-FIM = 'S'
- PERFORM 090-TERMINAR
- STOP RUN
- .
- *--------------------------------------------------------------*
- * PROCEDIMENTOS INICIAIS
- *--------------------------------------------------------------*
- 010-INICIAR.
- PERFORM 025-LER-SYSIN
- .
- *--------------------------------------------------------------*
- * LEITURA DADOS DA SYSIN
- *--------------------------------------------------------------*
- 025-LER-SYSIN.
- ACCEPT WS-REG-SYSIN FROM SYSIN
- IF WS-REG-SYSIN = ALL '9'
- MOVE 'S' TO WS-FIM
- ELSE
- ADD 1 TO WS-CTLIDO
- END-IF
- .
- *--------------------------------------------------------------*
- * PROCESSAR DADOS RECEBIDOS DA SYSIN ATE FIM DOS REGISTROS
- *--------------------------------------------------------------*
- 030-PROCESSAR.
- MOVE WS-NOME-IN TO WS-DET-NOME
- MOVE WS-NOTA1-IN TO WS-DET-NT1
- MOVE WS-NOTA2-IN TO WS-DET-NT2
- COMPUTE WS-MEDIA = (WS-NOTA1-IN + WS-NOTA2-IN) / 2
- MOVE WS-MEDIA TO WS-DET-MEDIA
- DISPLAY WS-DETALHE
- PERFORM 025-LER-SYSIN
- .
- *--------------------------------------------------------------*
- * PROCEDIMENTOS FINAIS
- *--------------------------------------------------------------*
- 090-TERMINAR.
- DISPLAY ' *========================================*'
- DISPLAY ' * TOTAIS DE CONTROLE - RSPRG002 *'
- DISPLAY ' *----------------------------------------*'
- DISPLAY ' * REGISTROS LIDOS - SYSIN = ' WS-CTLIDO
- DISPLAY ' *========================================*'
- DISPLAY ' *----------------------------------------*'
- DISPLAY ' * TERMINO NORMAL DO FTCOB006 *'
- DISPLAY ' *----------------------------------------*'
- .
- *---------------> FIM DO PROGRAMA FTCOB006 <-------------------*
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement