Skip to main content

REWRITE in Server Express apparently produces duplicate record

  • February 15, 2013
  • 0 replies
  • 0 views

Problem:

After performing a REWRITE in a COBOL program, a grep of the file written to may show the record twice. This does not happen with Object COBOL Developer Suite.

Resolution:

The Server Express file handler attempts to write new data to a file as quickly and as securely as possible. It achieves this by writing a new copy of the record in a different place on the file and  marking the 'old' record for deletion. Thus even if there is a crash before the index is updated, reading the file will give the correct information.

Records marked for deletion will show up in a 'rebuild -f' as Type 2 records. A proper rebuild will remove them.

The only downside to this way of working is that a grep of the file while Type 2 records still exist on there will show them as apparently present. This is potentially confusing, but the advantages of working in this way outweigh the disadvantages (old records can after all never be accessed).

Old KB# 2052

#ServerExpress
#AcuCobol
#netexpress
#RMCOBOL
#COBOL

0 replies

Be the first to reply!