Web Enablement: Challenges and Solutions Revision 1
In January 2003 I discovered an error in my paper presented at the
11th Natural Conference,
Web Enablement: Challenges and Solutions.
Actually the error was introduced after the original paper (HTML document)
was submitted to Jim Wisdom, and thus resided in the copy on the
University of Arkansas web site.
This document descibes the cause for the error and the correction, which
has been incorporated into the document -- thus the revision date.
The error had to do with the topic of Browsing ADABAS Data for
MU Type Descriptors.
It specifically involved the value used for #START-ISN
with the READ ... STARTING WITH ISN
which is coded within
the HISTOGRAM
loop.
The paper indicates that this value is reset to zero after the first time
through the HISTOGRAM
loop since we only need this value to restart reading
records for the first descriptor value following a page forward or backward request.
Subsequently we want all records and a zero STARTING WITH ISN
provides
all records -- even when reading descending.
I learned that it worked this way during the preparation
of this paper.
Previously I had coded (and what is running in production)
the assignment of #START-ISN
based upon the
read direction as follows:
IF *COUNTER(HKEYW.) GT 1
/* Only restrict the records in the READ for the first key
IF #DIRECTION = 'A'
RESET #START-ISN
ELSE
#START-ISN := 4294967295 /* Highest possible ISN
END-IF
END-IF
|
When I learned that a read descending starting with ISN value
of zero would provide all records, I assumed it was much preferred over setting the
value to the highest possible ISN.
What I did not realize is that this introduced a bug in the subsequent code that
checks for reading the same record two more times for the same descriptor value.
This is where the correction has been made to the paper.
The original code provided for this purpose is:
IF NOT HKEYWV.#MENU-KEYWORD = DBV.MENU-KEYWORD(*)
OR /* Ensure we don't cycle around
(#DIRECTION = 'A'
AND *ISN(RKEYW.) LE #START-ISN)
OR
(#DIRECTION = 'D'
AND *ISN(RKEYW.) GE #START-ISN)
ESCAPE BOTTOM
END-IF
#START-ISN := *ISN(RKEYW.)
|
This worked fine when the #START-ISN
value was the actual
record we wanted to start with or high values, but it does not work with
a zero value. The corrected code I have chosen to use follows (although another
alternative would be to use the high value ISN when reading descending):
IF NOT HKEYWV.#MENU-KEYWORD = DBV.MENU-KEYWORD(*)
OR /* Ensure we don't cycle around
(#DIRECTION = 'A'
AND *ISN(RKEYW.) LE #START-ISN)
OR
(#DIRECTION = 'D'
AND #START-ISN NE 0 /* < -- added statement
AND *ISN(RKEYW.) GE #START-ISN)
ESCAPE BOTTOM
END-IF
#START-ISN := *ISN(RKEYW.)
|
My sincere apologies to anyone that has been mis-lead by this error.
It certainly caused some difficulties here at the U of A.