Welcome to myCobol.net Monday, 04 July 2022, 08:27


Introducing CoCoS

  • Contributed by:
  • Views: 1,808
CoCoS CoCoS stands for Common Coding Standards, or alternatively Common Cobol Standards or Cobol Coding Standards.
It is pronounced as [kókòz] and spelled charlie-oscar-charlie-oscar-sierra.

With CoCoS the opportunity opens to develop Cobol Systems and Programs in a universal way with common agreement and understanding when reading Cobol Sources.

CoCoS is not a framework, but might be seen as such. The suggested Standards do, however, interfere with program flow and support good practice.

The ruleset does not contain syntactic sugar, though the association with the name calls for it: you need hard labor to crack it and the internals will reward you.

Common Block

  • Contributed by:
  • Views: 2,407

Cobol has no global data, i.e. data items that are shared among several program units (subroutines). The only way to pass information is to use the call parameter list. Sometimes this is obfuscating the Cobol text, e.g., when many subroutines share a large set of parameters. In such cases one can use a common block. This is a way to specify that a set of data items should be shared among  subroutines. But in general, the number of common blocks should be minimized.

On Maturity

  • Contributed by:
  • Views: 1,633

Learning to write Cobol Text is considered easy. One may feel dumb when forced to write the four divisions and some -- always present -- default sections. However, it is fast recognized that starting with a template, a sort-of empty program, would overcome this. At least we are very used to this technique when working with a text processor like a office suite.

So we learn. And that is why CoCoS distinguishes between newbee's, junior, medior, senior Cobol programmers and the professional use of Cobol. Because we all apply different tricks and expose different habits depending on our knowledge, our track record, our colleagues, etc. Not to forget the standards imposed by the employer or contractor.

Debugging your Cobol Text

  • Contributed by:
  • Views: 1,749
CoCoS It is often heard, generally speaking, from programmers that finding a bug takes time and that is hard to asses too. Could be 5 minutes (if you just would let me...), 2 hours or maybe even a couple of days. No prediction.

According to CoCoS that can't be true. Hunting bugs is time consuming, indeed, but, besides writing your Text in anticipation of a debug session at some point of time, the time necessary to find the misbehavior (often due to a typo) can be reduced and even easily assessed.

UPPERCASE, lowercase, camelCase

  • Contributed by:
  • Views: 11,979

When Cobol was conceptualized, computer characters were mainly uppercased. Functions like ignoreCase were not available and did not even circulate the minds of IT professionals. And there is no need, nowadays, to stick to UPPERCASE.

While in the originating years (70's) of Cobol's growth, the programs were large and often monolithic. That did not change much over the years, but today's demands are for relative short programs that can be used as building blocks of complete systems. In short: callable subprograms, or subroutines, that can be fit in a control structure embedded in a OLTP queueing system of choice.

Discover Q

  • Contributed by:
  • Views: 1,681
CoCoS Cobol is English. Naming things in Cobol, if English is your mother tongue, could be tricky since there are so much reserved words defined.
Apply some tricks to avoid a clash with reserved words.