Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/gsteixeira/havingfun-with-cobol

Fundamental and very basic stuff in Cobol
https://github.com/gsteixeira/havingfun-with-cobol

Last synced: about 5 hours ago
JSON representation

Fundamental and very basic stuff in Cobol

Awesome Lists containing this project

README

        

# Having Fun With Cobol
Fundamental and very basic stuff in Cobol

When I started learning COBOL my biggest challenge was to search fundamental stuff. So I had to look a lot of code to find How to do specific things.

Here a list of fundamentals. Most programs do a single specific thing and nothing else, so you can use it as reference.

*hello.cob* - Hello World!

*loops.cob* - The various and crazy ways to do loops in cobol.

*strings.cob* - string operations.

*subroutine.cob* - basic call of a subroutine (or program, or function).

*subroutine2.cob* - subroutine call passing variables back and forth.

*command_line.cob* - passing arguments to cobol program via command line.

*arrays.cob* - array, also shows how to generate random numbers.

*files.cob* - file operations, input output.

*random.cob* - random number generation.

*env_var.cob* - how to get value from environment variable in cobol.

*time_operations.cob* - functions with time and date.

*primes.cob* - generate a list of prime numbers.

*fibonacci.cob* - print the fibonacci sequence.

*palindrome.cob* - check if a string is palindrome.

*postgres1.cob* - get data from postgresql with COBOL (didatic version).

*postgres2.cob* - postgres with COBOL (less monolithic, less didatic).

*postgres.cob* - tries to be more clean and production friendly.

*python_bindings* - calling COBOL from Python and passing variables.

- Pardon my antipattern!

The thing I find harderst reading existing cobol code is the fact that most developers sadistically use very obfuscative standards in their variables names. They often have names like "WS-XKY-ENIGMATIC", of paragraphs like "A-PARA-1". As you can see, hifens, ALL_CAPS, and weird names. Also little Ident doesn't hurt.
This programs are done for educational purposes, so I'll follow more modern conventions of naming. :)