HP3000-L Archives

February 1999, Week 2

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Jim Phillips <[log in to unmask]>
Reply To:
Jim Phillips <[log in to unmask]>
Date:
Tue, 9 Feb 1999 15:52:08 -0500
Content-Type:
text/plain
Parts/Attachments:
text/plain (47 lines)
Tony Furnival writes:

>This is also, fairly 'obvious', in the same sense that the original answer
>was. COBOL allows you to intercept the error condition (with the File
Status
>data item). It is up to you to check this and react appropriately. I've
>"occasionally" (this is a new spelling of the word "often!) been caught by
>this. Because there will "never, ever" be a problem with the WRITE, I
don't
>check it, and as a result the program blissfully informs me that it
couldn't
>write the 10001st record. Sometimes it does this for 12 hours overnight.
>Isn't it wonderful how computers don't get bored with repetitious
activity!

>Seriously, though, if there is a File Status item associated wth the file,
>and no visible means of reporting out erroneous results, the results will
>continue to be unreported and erroneous. The file never got bigger than
>10000 reords, it just managed to clobber all the input data, which leads
to
>the "deep problem", where's the backup?

Yes, but. . .

JT said there was no error checking going on at all, which to me implies 
no FILE STATUS clause on the SELECT (JT: Can you verify this?).  And why 
would anybody put a FILE STATUS clause on an output-only file (which will 
have only WRITES's processed against it) and then not check the status 
code after the write?  Of course, why would anybody change a file equation 
in a JCL and not think about the consequences?  Guess we'll just have to 
ask Cooter! :-)

Of course, Tony is correct.  One of the pitfalls of COBOL is that you 
can't do error checking half-way.  If you add the FILE STATUS clause, 
then you must check the status code after every I/O operation, because 
the COBOL compiler will *assume* that you know what you're doing and 
not do any error checking for you, like it does if you leave the FILE 
STATUS clause off and don't have DECLARATIVES.

But then again, I've seen Image data base programs that never check 
the status after an Image call either.

Jim Phillips                            Manager of Information Systems
Voice: (330) 527-2124                   Therm-O-Link, Inc.
  Fax: (330) 527-2123                   PO Box 285; 10513 Freedom St.
Email: [log in to unmask]       Garrettsville, Ohio  44231

ATOM RSS1 RSS2