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
|