Go Back
2 Votes

Provide distinct error codes for empty or missing IS1 (ISAM) files


Recently one of our Windows customers encountered a situation where a couple of IS1 files were completely empty and had a Size of 0.  (Essentially the same as a text file with no data.)

We don’t know how the IS1 files got to that state, but when it occurred an attempt to open the ISM file generated an Error 18 (File Not Found).   Based on the error, our program then proceeded as if the file didn’t exist, which in this case entailed creating a new file and then processing as if everything was OK.

Since both the ISM and IS1 files did actually exist, I think the Error 18 was misleading and believe some other error should have been generated indicating ISAM file corruption.

Similarly, I have tested to see what happens if an IS1 file is missing completely, and that too generates an Error 18.  While that result is more defensible it is still misleading, as the lack of an IS1 file when an ISM file exists would also signal a form of ISAM file corruption that programmatically should NOT be treated the same as a missing ISAM file.

So, my idea is to no longer generate an Error 18 in the 2 circumstances outlined above, and instead generate a new error code indicating ISAM file corruption.

In our case, it took over a day to unravel all of the problems created by receiving an Error 18 and processing as if the file did not exist.  But we were lucky, it could have been worse.

I have presented this to Synergex Support, and the response from Development was "It seems the changes that need to be made would be quite significant and not just a handling of the error message. Therefore, it is their position that this be placed in Ideas to see if this situation warrants a deep dive into finding a solution."

So hopefully there are some others who share my concern and feel that receiving a File Not Found error when a file actually exists is something of a problem.

Thanks.


 

2 Comments | Posted by Bill Ferris to Synergy DBL, Synergy DBMS on 2/16/2022 1:41 PM
Geoff MacCue
Hi Bill,
I use a function wrapper for file OPEN, this way I can capture more errors such as the one you recently encountered.

In your case the function would attempt to open the ISM file and if it fails with an error 18 it would then try and open each of the ISAM files ISM and IS1 in INPUT mode "I".
If both files exist then we know the ISAM file is corrupt and can report it back to the calling program. (We also log the error in a system ERROR.LOG file; if it is at a customers site we would also attempt to send an email to our support staff alerting them of the failure.)

When opening the ISM and IS1 files in INPUT mode you are only interested in error 18, any other error such as 38-File in Use, 40-Record Locked indicate the file exists.

2/17/2022 11:48 PM   0  
Bill Ferris
Geoff --

Yes, we can always write code that works around Synergy shortcomings.  But when it comes to error messages I think it is incumbent upon Synergy to be accurate.

The logic you describe is something that could just as easily be written by Synergex, to the benefit of all developers.

2/18/2022 12:30 PM   0  
Please log in to comment on this idea.