Short sample programs that illustrate how to carry out various programming tasks in Cobol.
On z/OS, compile-link-go. HEX2TEXT is a subprogram. The other samples are main programs.
On Linux, Unix, Windows, or OS X, install a Cobol compiler that offers source-level compatibility with IBM Enterprise Cobol. Compile HEX2TEXT as a subprogram (.so or .dll), and the other sample programs as main programs.
Assuming Linux and GnuCOBOL, you can use these Bash scripts to compile and run the sample programs. Use -s for a subprogram (e.g., HEX2TEXT). Script compile-all compiles all the programs in src/main/cobol.
- compile [-s] programname
- compile-all
- run programname
- MOVEME ...assign values to Data Division items?
- IFEVAL ...use IF/ELSE and EVALUATE for conditional logic?
- COND88 ...work with condition names (or 88-level data items)?
- NOTBOOL ...work with legacy workarounds for boolean values?
- CPSEQFR ...read and write sequential (QSAM) files with fixed-length records?
- CPSEQVR ...read and write sequential (QSAM) files with variable-length records ?
- STRINGIT ...use INSPECT, STRING, and reference modification to manipulate text data?
- HELLO ...eliminate trailing spaces in variable-length text data?
- REFORMER ...use various Cobol statements to reformat records?