Giter Site home page Giter Site logo

jordangaspar / cobol-cpf Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 4 KB

Verificador de CPF escrito em COBOL. Seguindo as instruções do projeto GnuCobol é possível adaptar tal código a qualquer linguagem compatível com a linguagem C.

License: MIT License

COBOL 98.20% Makefile 1.80%
cobol cpf cpf-validador cpf-validator

cobol-cpf's Introduction

COBOL-CPF

Validador de CPF escrito em COBOL

Como usar?

O uso é bastante simplificado. O texto a ser validado deve conter 15 caracteres, sendo o último um caracter em branco. O texto também deve ser bem formado, possuindo o formato XXX.XXX.XXX-XX, sendo X o equivalente aos números do CPF.

Também deverão ser criados espaços para receber a notificação de validade (CPF-RETURN - 'Y' ou 'N'), como também a mensagem sobre a situação do número (CPF-STATUS).

Para testar faça:

git clone https://github.com/JordanGaspar/COBOL-CPF.git
cd COBOL-CPF
make
make run

Após o teste, a limpeza dos arquivos poderá ser feita pelo comando make clean.

Abaixo o exemplo de testes:

       IDENTIFICATION DIVISION.
       PROGRAM-ID. TEST.
       DATA DIVISION.
       WORKING-STORAGE SECTION.
       01 CPF-INPUT-OUTPUT.
           05 CPF-RAW PIC X(15).
           05 CPF-RETURN PIC X.
           05 CPF-STATUS PIC X(50).
       PROCEDURE DIVISION.
           INITIALIZE CPF-RAW.
           DISPLAY 'FROM TEST!'.
           MOVE "123.456.789-09 " TO CPF-RAW.
           CALL 'CPF' USING BY REFERENCE CPF-RAW.
           DISPLAY CPF-STATUS.
           STOP RUN.

O código foi testado usando o GnuCOBOL.

cobol-cpf's People

Contributors

jordangaspar avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.