[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[open-cobol-list] Re: OC issues - number 7

From: Roger While
Subject: [open-cobol-list] Re: OC issues - number 7
Date: Wed Jan 18 13:46:13 2006

This is typical of what one sees on old mainframe programs.
In fact, judging by the names, what Sergey has done is to reduce
the problem to a test example.
The reason that constructs like this were done in the old
days was to conserve memory. Effectively "packing" the
fields. Defining each field on an 01 level would align the
field on the machines natural boundary therefore taking
much more room. This did not have any runtime performance
consequences on alignment tolerant machines like the 390.


It looks like very bad code to me. You define the group item "T"
as computational. Then you define subfields under it.
Each of these fields are signed, which means
that the fields have to have room for a sign byte or nibble.
Also, a COMP field soes not measure out the same length as its
count in decimal digits. An S9(4) field, depending on the
hardware, may require  various lengths in bytes. On a word
oriented machine it could be a half word or full word.

There is no need to define the group item as COMP. That
definition is best left to the elementary items, those with PIC
clauses. Indeed there is no real need to group the above data
fields at all.  They can all be defined as 01 or 77. Just because
the standard says you can do someting doesn't mean that you
should do something. I cannot ever recall having assigned COMP,
COMP-3 etc. to a group item. And I have been writing COBOL since

We waste time trying to write nonsense code code designed to break
compilers. The answer in every case is to write sensible code.
Given the fact that major features like the SCREEN SECTION are
still missing, playing around with silly scenarios is not useful.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]