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

Re: [GNU-COBOL] New to COBOL




> > > Numeric-edited fields and alphanumeric-edited fields would be
> > > particularly enjoyable.  Floating or fixed insertion symbols
> > > (+, - or $), zero suppression with blank or asterisk replacement,
> > > CR and/or DB symbols, BLANK WHEN ZERO, and so forth.
> >
> > These would be a property of the instance of the display method,
> > rather than the data, I think (coming to this with no experience of
> > COBOL whatsoever.)
> 
> In practice this is indeed editing at the time the field is filled with
> data (coming to this with 29 years experience of Cobol).

Umm ... well ... yes and no.  The actual editing -- and thus the errors
-- can happen when you try to *use* the variable.  If you have a numeric
elementary field as a part of a group field (which is always assumed to
be alphanumeric), moving letters to the group field is permitted, but if
you then try to use the elementary field which is defined as numeric but
the storage of which now contains letters, you cause an abend.  (S0C7, I
would think.)

> To answer your question : no, Cobol gives you the possibility to read a
> _record_ of a tape, but not a block.

Read a file, write a record -- but yeah, that's right. :-)

> Mounting of a tape with or without a name depends on the LABEL IS
> clause.

The LABEL RECORDS clause, you mean?  That is considered optional in
COBOL 85, and is considered to be a function of the operating system.

> Note that Cobol programs assume they're started after a check for the
> necessary resources. It's not common practice to test if problems arise
> after opening a file.

I've not been working *near* as long as you have, so I can't argue what
*common* practice is.  On the other hand, I will certainly argue that it
is a *good* practice to test for error conditions after every I/O
operation and provide for a graceful exit.  Probably just a structured
programming bias, but one I hold near and dear.


-- 
David R. Ondrejko - EDI/Referral - Safelite Glass Co.
 Mathematician by training - Programmer by trade - Philosopher by nature
 Genius by genetics - Atheist by conviction - Hedonist by desire!

--
This message was sent through the gnu-cobol mailing list.  To remove yourself
from this mailing list, send a message to majordomo@lusars.net with the
words "unsubscribe gnu-cobol" in the message body.  For more information on
the GNU COBOL project, send mail to gnu-cobol-owner@lusars.net.