by COBS Tech Support » Fri Sep 16, 2005 2:19 am
While it could be due to illegal characters in the database this is not very likely, especially if you don't see any other corruption visible in the job cards.
Unfortunately it could also be the case that at some point in the past, STAUX000.CDX (user fields for job cards) got damaged so that some of the auxiliary records could not be "seen" by the system. If the system can't see those records, it will create new ones.
When an automatic repair or database maintenance is eventually executed, those records become viewable again, including the ones that were created twice. Now there are duplicates.
When the system goes to change the job number, it changes one of those records but not both (because there should only be one record in STAUX000.DBF for each record in SMJOBS.DBF the system won't look for duplicates because it isn't expecting to find any.)
Another possibility is that it wasn't that STAUX000.CDX was damaged but that a different version of STAUX000.DBF was copied into the database in the past, knocking everything out of sync. (This happens sometimes when a table gets destroyed due to some kind of OS or hardware malfunction--and the IT person or the end-user just restores the damaged file from their back-up rather than restoring the entire back-up of the company data. Years can pass before the problem gets noticed. Mixing different files with different contents is always extremely risky...)
To test this theory try creating a new job card with user field data and then change the job number several times. Do *new* records work OK? When doing this test, try to use an unusual job number that won't clash with a real job number that might still be sitting in the system as bad data.
If this is the problem there is just no automatic way for the software to clean this up. It can't tell which records in STAUX000.DBF are the "good" ones and which are the "bad" ones. In fact the end-user may not be able to tell either! It might be safest not to change job numbers for old records, and start with a new job number sequence only for new jobs from now on.
One other thing to do that's important: load SMAUX000.DBF into Excel and sort the spreadsheet on the job number column. Make sure there are no job numbers *already there* for the new job sequence you intend to use. If they are, you'll have problems even when adding new jobs.
You could also load SMJOBS.DBF into Excel and then compare the job numbers between it and SMAUX000.DBF and see what is out of sync for yourself. However, it's up to you if you really want to go that kind of trouble... but it might give you some clues as to the extent of the problem/damage in there.
E.g., you could sort both tables by the job number column, then compare them side by side, looking at the job number sequence and checking for duplicates or missing records. (Missing records may be "normal" but duplicates definitely are NOT.) However, even if you go to that trouble it's not clear to me what you could really do about it, as per my comments above. Selecting and sticking with a fresh transaction sequence should allow the user to continue to use the existing database even if some of the older records in it have some damage.