Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- IDENTIFICATION DIVISION.
- PROGRAM-ID. PESSOAS.
- AUTHOR. MARCO.
- ENVIRONMENT DIVISION.
- CONFIGURATION SECTION.
- SPECIAL-NAMES.
- DECIMAL-POINT IS COMMA.
- INPUT-OUTPUT SECTION.
- FILE-CONTROL.
- SELECT PESSOAS ASSIGN TO "PESSOAS.DAT".
- * FILE STATUS IS FS-ERRO.
- DATA DIVISION.
- FILE SECTION.
- FD PESSOAS.
- * DATA RECORD IS REG-PESSOA.
- 01 REG-PESSOA.
- 03 FD-CODIGO PIC 9(06).
- 03 FD-NOME PIC X(30).
- 03 FD-CELULAR PIC X(13).
- WORKING STORAGE SECTION.
- 77 WS-AUTOR PIC X(05) VALUE "MARCO".
- 77 FS-ERRO PIC X(02) VALUE SPACES.
- 77 WS-MENSAGEM PIC X(01).
- 01 WS-VAR.
- 03 WS-VAR-LIMPA PIC X(30) VALUE SPACES.
- 03 WS-VAR-CONT PIC 9(03) VALUE ZEROS.
- 01 WS-CODIGO PIC 9(06).
- 01 WS-NOME PIC X(30).
- 01 WS-CELULAR PIC X(13).
- 01 WS-DATA.
- 03 WS-ANO PIC 9(04).
- 03 WS-MES PIC 9(02).
- 03 WS-DIA PIC 9(02).
- SCREEN SECTION.
- 01 TELA.
- 03 BLANK SCREEN.
- * -------------------- APRESENTACAO --------------------------
- 03 LINE 01 COLUMN 60 VALUE "DATA: ".
- 03 LINE 01 COLUMN 30 VALUE "CADASTRO DE PESSOAS".
- 03 LINE 10 COLUMN 10 VALUE "CODIGO.: ".
- 03 LINE 11 COLUMN 10 VALUE "NOME...: ".
- 03 LINE 12 COLUMN 10 VALUE "CELULAR: ".
- * -------------------- INSERCAO DE DADOS ---------------------
- 03 WS-CODIGO
- LINE 10 COLUM 20 USING FD-CODIGO
- HIGHLIGHT.
- 03 WS-NOME
- LINE 11 COLUM 20 USING FD-NOME
- HIGHLIGHT.
- 03 WS-NOME
- LINE 12 COLUM 20 USING FD-NOME
- HIGHLIGHT.
- 01 LISTA.
- 03 BLANK SCREEN.
- * -------------------- LISTAGEM ------------------------------
- 03 LINE 01 COLUMN 60 VALUE "DATA: ".
- 03 LINE 01 COLUMN 30 VALUE "LISTAGEM DE PESSOAS".
- * 03 LINE 10 COLUMN 10 VALUE "CODIGO.: ".
- * 03 LINE 11 COLUMN 10 VALUE "NOME...: ".
- * 03 LINE 12 COLUMN 10 VALUE "CELULAR: ".
- PROCEDURE DIVISION.
- 10-INICIO.
- OPEN EXTEND PESSOAS
- IF ST-ERRO = "30"
- OPEN OUTPUT PESSOAS.
- CLOSE PESSOAS.
- ELSE
- MOVE ZEROS TO FD-CODIGO
- MOVE SPACES TO FD-NOME
- MOVE SPACES TO TELEFONE.
- ACCEPT WS-DATA FROM DATE.
- DISPLAY TELA.
- STOP RUN.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement