Skip to main content

error codes with I$IO

  • October 11, 2012
  • 5 replies
  • 0 views

Is it possible to get the standard error codes when I$IO fails for some reason?

By "standard error codes" i mean those raised by the standard functions write, read key, read next, open, close and so on.

For example if try to rewrite a record  with I$IO (set rewrite-function to true in I$IO)  and the record key is not found i would like to get the error code "23", like with the "rewrite" statement, while F-ERRNO return "4" (E-MODE-CLASH in filesys.def).

Does it exist a way to get the code i need?


#error-codes
#COBOL
#IIO

5 replies

  • Author
  • Rocketeer
  • 19312 replies
  • October 11, 2012

Is it possible to get the standard error codes when I$IO fails for some reason?

By "standard error codes" i mean those raised by the standard functions write, read key, read next, open, close and so on.

For example if try to rewrite a record  with I$IO (set rewrite-function to true in I$IO)  and the record key is not found i would like to get the error code "23", like with the "rewrite" statement, while F-ERRNO return "4" (E-MODE-CLASH in filesys.def).

Does it exist a way to get the code i need?


#error-codes
#COBOL
#IIO

Another question: how can i tell that i have reached the end of file using NEXT-FUNCTION in i$IO? Documentation says that the return code is set to 0... but it is also when the function fails when errors occur...


  • Author
  • Rocketeer
  • 19312 replies
  • October 11, 2012

Is it possible to get the standard error codes when I$IO fails for some reason?

By "standard error codes" i mean those raised by the standard functions write, read key, read next, open, close and so on.

For example if try to rewrite a record  with I$IO (set rewrite-function to true in I$IO)  and the record key is not found i would like to get the error code "23", like with the "rewrite" statement, while F-ERRNO return "4" (E-MODE-CLASH in filesys.def).

Does it exist a way to get the code i need?


#error-codes
#COBOL
#IIO

Another question: how can i tell that i have reached the end of file using NEXT-FUNCTION in i$IO? Documentation says that the return code is set to 0... but it is also when the function fails when errors occur...


  • Author
  • Rocketeer
  • 19312 replies
  • October 11, 2012

Is it possible to get the standard error codes when I$IO fails for some reason?

By "standard error codes" i mean those raised by the standard functions write, read key, read next, open, close and so on.

For example if try to rewrite a record  with I$IO (set rewrite-function to true in I$IO)  and the record key is not found i would like to get the error code "23", like with the "rewrite" statement, while F-ERRNO return "4" (E-MODE-CLASH in filesys.def).

Does it exist a way to get the code i need?


#error-codes
#COBOL
#IIO

Another question: how can i tell that i have reached the end of file using NEXT-FUNCTION in i$IO? Documentation says that the return code is set to 0... but it is also when the function fails when errors occur...


Stephen Hjerpe
  • Participating Frequently
  • 1100 replies
  • October 26, 2012

Is it possible to get the standard error codes when I$IO fails for some reason?

By "standard error codes" i mean those raised by the standard functions write, read key, read next, open, close and so on.

For example if try to rewrite a record  with I$IO (set rewrite-function to true in I$IO)  and the record key is not found i would like to get the error code "23", like with the "rewrite" statement, while F-ERRNO return "4" (E-MODE-CLASH in filesys.def).

Does it exist a way to get the code i need?


#error-codes
#COBOL
#IIO

I don't know of a function or configuration variable to turn the f-errno values into a proper COBOL file status


Stephen Hjerpe
  • Participating Frequently
  • 1100 replies
  • October 26, 2012

Is it possible to get the standard error codes when I$IO fails for some reason?

By "standard error codes" i mean those raised by the standard functions write, read key, read next, open, close and so on.

For example if try to rewrite a record  with I$IO (set rewrite-function to true in I$IO)  and the record key is not found i would like to get the error code "23", like with the "rewrite" statement, while F-ERRNO return "4" (E-MODE-CLASH in filesys.def).

Does it exist a way to get the code i need?


#error-codes
#COBOL
#IIO

Not sure if you have seen this, alfred.cbl .. AcuGT\\sample\\alfred\\source .. is a good example of using I$IO