|
Bob Cozzi wrote: > > But then how do you check for the error condition's status error code? > If %STATUS is truly set all the time? > I thought the philosophy was use (E), then check for an error by looking > at %ERROR, if it was *ON, then you'd look at %STATUS to see what the > specific error was. But if %STATUS is always set, why do you still need > %ERROR? Is %STATUS always set or not? > Bob, %STATUS is set when the status changes. %STATUS(file) is zero after a successful I/O operation. If you code this: read(e) file then if eof occurs, %ERROR will be off but %STATUS(file) will be 10 or 11, I forget which. In the case of reade(e) file, after the operation, the following combinations are possible: %error | %status(file) | meaning ---------+-------------------+------------------------------------ '0' | 0 | a record was read '0' | 00010 (00011?) | end of file, no record read '1' | > 1000 | an error occurred, no record read In the case of setll(e) %error | %status(file) | meaning ---------+-------------------+------------------------------------ '0' | 0 | a record was found '0' | 00011 (00010?) | no record found '1' | > 1000 | an error occurred (record may or may not exist) Why do you need %ERROR? You could do without %ERROR and just test %STATUS > 99 to test for errors, but %ERROR is better than hardcoding 99 or 100, I think.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.