In "Duplicate Record WRITE Performance," in TechTalk (MC, January 1995), Blair Hamren explains how to gain performance improvement and a smaller joblog by using a CHAIN to check for duplicate records before writing to a database file instead of using a WRITE with an error indicator specified.
Assuming it is a CHAIN by key, an even more efficient way to accomplish this would be to use the key value with the SETLL op code and an *EQ indicator in the equal column. If the specified indicator is *ON after the SETLL, then the key exists. The benefit is that you find out if the key exists without doing a disk I/O, and you avoid overlaying your original record field values with the values from the "chained" record.
LATEST COMMENTS
MC Press Online