Error when deleting the last record out of a file

Mike Schwartz mschw at athenet.net
Thu Dec 13 15:13:16 PST 2007


     One of my customers (filePro 5.0.5K2R4, SCO Unix 5.0.6) has a general
purpose temporary storage file that can be used to hold records temporarily
when running various reports.  The first field is the TTY number, the second
field is a 2 letter application ID, AP=accounts payable, etcetera, and the
3rd is a 2-letter report ID ("32" is the number I was assigned for this
project).  After that there are ten 60-character "general purpose" alpha
data fields.  There is only one automatic index (old pre-4.5 index) that
spans the first 5 fields (length 132).  

    This file is used simultaneously by multiple applications and multiple
users concurrently.  I can't simply blow away the entire key file (ddir
-KA), because other users may be storing new records in the file at the same
time I'm trying to remove my old records.  

    The system works fine, except when finish my processing, I need to
delete out all the records I have put there, and when I am deleting the very
last record out of the file, I get the error:

/u/filepro/storesort/indexabc.A: invalid argument

Dummy field tt contains the users tty#.

ClrSrt   If: 'Clear out the storesort file after we're done...
       Then: '(Also:  Clear HD32's before we start...)
220  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If:
       Then: lookup stx = storesort  K=("TTY")  i=A -bpG
221  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -
NXTstx   If: not stx                'No more recs to delete for HD32
       Then: sleep "1000";  return
222  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: stx(2)="HD" and stx(3)="32"
       Then: show ("10","1")  "Deleting" <stx(4)
223  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: stx(2)="HD" and stx(3)="32"
       Then: delete stx
224  -------   -   -   -   -   -   -
         If:
       Then: getnext stx; goto NXTstx

     I run this at the beginning of my processing and also at the end.  Note
the "greater than" at the end of the lookup.   Should I try a different
lookup key?  (There should never be any records in the file that starts with
anything other than TTY.)  During the overnight processing, this entire file
does get "blown away" with a ddir -KA command, so it starts clean each day.

     The show statement makes it appear that I'm reading through all 3,000
records I'm storing and then blowing up on the last record, or immediately
after the last record is deleted.  I'm probably getting an error on the
"getnext" as it reads off the end of the file or some such thing.    
 
Any suggestions?

Thanks!

Mike Schwartz





More information about the Filepro-list mailing list