Skip to content

neopragma/cobol-samples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cobol Samples

Short sample programs that illustrate how to carry out various programming tasks in Cobol.

How to run the sample programs

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

Using basic Cobol statements

How can I...

  • MOVEME ...assign values to Data Division items?

Conditional logic

How can I...

  • 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?

Working with datasets

How can I...

  • CPSEQFR ...read and write sequential (QSAM) files with fixed-length records?
  • CPSEQVR ...read and write sequential (QSAM) files with variable-length records ?

Working with text data

How can I...

  • 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?

Working with numeric data

How can I...

  • INVCALC ...code business calculations in Cobol?
  • BRAKES ...code engineering calculations in Cobol?
  • ATTRACT ...code scientific calculations in Cobol?

Working with dates and times

How can I...

  • DATE1 ...get the current date and time using the CURRENT-DATE intrinsic function?
  • DATE2 ...get the current date and time using the Cobol ACCEPT statement?
  • HourGlass ...set a date and time for the duration of a job or job step?

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published