Strange Quiz data conversion error
Mike Palandri
palandri@eug4ja.lane.edu
Fri, 15 Feb 2002 05:07:00 -0800
Powerhouse 7.10F3 OpenVMS Alpha
I have subfile whose records conatain a single 80 byte char element,
DC-REC080. There are 3 header records, 2 trailer records, and 305
detail records. The detail records contain a right justified integer
in bytes 30-39 that needs to be totaled.
I have a select statement that correctly selects the 305 details, and
defined items to extract the integer. (This is done with two defines
because I need the character item DC-AMOUNT for another purpose.)
ACCESS *GLST426
SELECT IF DC-REC080[1:1] <> "$" AND DC-REC080[1:1] <> "W" &
AND DC-REC080[1:1] <> "\" AND DC-REC080[1:1] = "&"
DEF DC-AMOUNT CHAR*10 = DC-REC080[30:10]
DEF DI-AMT INT*10 = NCONVERT(DC-AMOUNT)
The problem is that the DI-AMT define always results in a single data
conversion error. It doesn't matter if I set the report limit to 1, 100
or NOLIMIT, ther is always one error. However, when I report both items,
DI-AMT is always converted correctly.
The SELECT *is* selecting the correct records, as only 305 are processed, and
I've examined them all.
Here's what's odd: I used the same SELECT to create a second subfile that
contains only the 305 detail records. The code runs fine against that
file. Somehow the presence of the header and trailer records in the original
subfile is causing the data conversion error, despite them being selected
out.
I can't use a second subfile in production, and even though the data
conversion error doesn't seem to harm anything, I'd like to eliminate it.
Any ideas?
Thanks,
Mike
.