Skip to main content

Open Output Print files (or Others) that already exist.

  • February 18, 2020
  • 2 replies
  • 0 views

Our programs were converted over from Wang Cobol 10 years ago @ Unicon. So Far so good until now. I am testing version 10.3.0 and have errors opening a file for output if that file already exists. Are there any routines or ??? available for handling a file that already exists? I would like the option to either scratch it or rename it if possible.

2 replies

Stephen Hjerpe
  • Participating Frequently
  • February 18, 2020

Our programs were converted over from Wang Cobol 10 years ago @ Unicon. So Far so good until now. I am testing version 10.3.0 and have errors opening a file for output if that file already exists. Are there any routines or ??? available for handling a file that already exists? I would like the option to either scratch it or rename it if possible.

You should be able to use the Declaratives to capture when file errors occur, then  write a routine to try opening the file INPUT first and if that succeeds then either rename it or scratch it depending on what is your preference


  • February 19, 2020

You should be able to use the Declaratives to capture when file errors occur, then  write a routine to try opening the file INPUT first and if that succeeds then either rename it or scratch it depending on what is your preference

ok I will give that a try,