IDENTIFICATION DIVISION.
       PROGRAM-ID.    FRAME.
       AUTHOR.        COBOLware Services Ltda.
       DATE-WRITTEN.  10/06/2005.
       SECURITY.      *************************************************
                      *                                               *
                      * Exemplo de tratamento de padrão de tela.      *
                      *                                               *
                      *************************************************
       ENVIRONMENT DIVISION.
       CONFIGURATION SECTION.
       SPECIAL-NAMES. DECIMAL-POINT IS COMMA.
       INPUT-OUTPUT SECTION.
       FILE-CONTROL.

       DATA DIVISION.
       FILE SECTION.

       WORKING-STORAGE SECTION.

       77  I        PIC 99    VALUE 0.
       77  C        PIC 99    VALUE 0.
       77  empresa  PIC X(30) VALUE SPACES.
       77  sistema  PIC X(30) VALUE SPACES.
       77  programa PIC X(08) VALUE SPACES.
       77  usuario  PIC X(30) VALUE SPACES.
       77  tracos   PIC X(80) VALUE ALL X'C4'.
       77  espacos  PIC X(80) VALUE SPACES.
       77  curdir   PIC X(50) VALUE SPACES.

       LINKAGE SECTION.

       01  OPTION PIC X.
       01  PARAMETRO PIC X(80).
       01  REDEFINES PARAMETRO.
           05 DESCRICAO-OPCAO PIC X(34).
       01  REDEFINES PARAMETRO.
           05 RODAPE          PIC X(68).
       01  REDEFINES PARAMETRO.
           05 OBS             PIC X(29).
       01  PARAMETRO2 PIC X(80).

       PROCEDURE DIVISION USING OPTION PARAMETRO PARAMETRO2.

       000-INICIO.

           EVALUATE OPTION
               WHEN 'f' *> Exibe observação de função de cadastro
                    DISPLAY (4, 1) OBS
               WHEN 'F' *> Exibe tela padrão e moldura
                    EXEC COBOLware GetSystem
                     SCREEN-APLICATION;sistema
                     SCREEN-COMPANY;empresa
                     PROGRAM;programa
                     USER;usuario
                    END-EXEC
                    DISPLAY (1, 1) ERASE
                    DISPLAY (1, 1) empresa
                    DISPLAY (2, 1) sistema
                    DISPLAY (3, 1) tracos
                    DISPLAY (23, 1) tracos
                    EXEC COBOLware Pack String usuario WIDTH I END-EXEC
                    COMPUTE C = 80 - I + 1
                    DISPLAY (1, C) usuario WITH SIZE I
                    EXEC COBOLware Pack String programa WIDTH I END-EXEC
                    COMPUTE C = 80 - I + 1
                    DISPLAY (2, C) programa WITH SIZE I
               WHEN 'E' *> Limpa área de trabalho da tela
                    PERFORM VARYING I FROM 4 BY 1
                            UNTIL I > 25
                            IF I <> 23
                               DISPLAY (I, 1) ESPACOS
                            END-IF
                    END-PERFORM
               WHEN 'O' *> Exibe Titulo da opção de menu selecionada
                    DISPLAY (2, 33) DESCRICAO-OPCAO
               WHEN 'M' *> Apaga linha de mensagem
                    DISPLAY (24, 1) ESPACOS
               WHEN 'P' *> Nome do programa
                    DISPLAY (25, 1) ESPACOS WITH SIZE 79
                    MOVE SPACES TO programa
                    DISPLAY (2, 73) programa
                    MOVE PARAMETRO (1:8) TO PROGRAMA
                    EXEC COBOLware Pack String programa WIDTH I END-EXEC
                    COMPUTE C = 80 - I + 1
                    DISPLAY (2, C) programa WITH SIZE I
               WHEN 'I' *> Atualiza empresa e sistema
                    MOVE PARAMETRO(1:30) TO empresa
                    MOVE parametro2(1:30) TO sistema
                    DISPLAY (1, 1) empresa
                    DISPLAY (2, 1) sistema
               WHEN 'N' *> Atualiza usuário e pasta corrente
                    MOVE SPACES TO usuario
                    DISPLAY (1, 51) usuario
                    MOVE PARAMETRO(1:29) TO usuario
                    EXEC COBOLware Pack String usuario WIDTH I END-EXEC
                    COMPUTE C = 80 - I + 1
                    DISPLAY (1, C) usuario WITH SIZE I
                    MOVE parametro2(1:50) TO curdir
           END-EVALUATE.

       000-99-FIM. GOBACK.
END PROGRAM FRAME.